Jump to content
Sign in to follow this  
knotten2

How to get the Drive letter from CD drive?

Recommended Posts

Yes I do apologize for not posting that in the post here. It does require Beta. I dont use anything else so I kinda forgot to post it in here. It is in the Computer Info UDF link in my signature, and in the link I posted above.

JS

Thanks!

Share this post


Link to post
Share on other sites

CODE: AutoIt

Dim $var ;All Cd Drives

Dim $Drive ;Drive letters

Dim $Label ;Drive Label

$var = DriveGetDrive( "CDROM" )

If NOT @error Then

;MsgBox(4096,"", "Found " & $var[0] & " drives")

For $i = 1 to $var[0]

;MsgBox(4096,"Drive " & $i, $var[$i])

$Drive = $var[$i]

;MsgBox(0,"", $Drive)

$Label = DriveGetLabel( $Drive )

If $Label = "Drivere" Then

MsgBox(4096,$Drive & "\",$Label)

RunWait($Drive & "\""devpath.exe", "","")

;RunWait ( "filename" [, "workingdir" [, flag]] )

;Run ($Drive & "\"devpath.exe & $Drive & "\"

Run ( 'mmc.exe ' & @SystemDir & '\devmgmt.msc' ) ;Åpner device manager etter at riktig Cd er satt inn

Endif

Next

EndIf

;Run(@SystemDir & "\mmc.exe " & @SystemDir & "\devmgmt.msc /s "))

;Run ( 'mmc.exe ' & @SystemDir & '\devmgmt.msc' )

;devmgmt.msc Åpner device manager

;RunWait(@ComSpec & " /c " & 'commandName', "", @SW_HIDE)

The"devpath.exe" is usaly runed from a cmd window, but I want to run it with the input from $Drive & "\"

I have tried;

RunWait ( "devpath.exe"$Drive & "\" , $Drive & "\" )

But no luck....

Can somebody help me :whistle:

Edited by knotten2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...