Guest cjschrattenthaler Posted September 14, 2005 Posted September 14, 2005 Hi! Is it possible to get the drive letter from the drive the EXE file is run? Because, I want to create a CD-Menu, and I want to open the Windows Explorer for "Search CD-Rom...", and I want link the user directly to the CD-Rom drive, and not only start the Explorer. Thanks, Christian.
Guest cjschrattenthaler Posted September 14, 2005 Posted September 14, 2005 Hi! I found a working solution: Create a script file "starte_WindowsExplorer.au3": *** ; AutoIt Version: 3.0 ; Author: Christian-Josef Schrattenthaler ; Beschreibung: Dieses Script ermittelt das aktuelle Laufwerk, und startet anschließend den Windows-Explorer. ; Aktuelles Laufwerk ermitteln: $aktuellesLaufwerk = StringLeft(@ScriptDir, 3) ; Windows-Explorer starten: Run("Explorer.exe /e," & $aktuellesLaufwerk) ; Ende. *** Compile Script to .exe Create a "fscommand" folder in the same folder as the flash file is. Copy the AutoIt .exe file in this folder. Now you can call the AutoIt .exe file over "fscommand("exec","starte_WindowsExplorer");" in the flash file. Greetings, Christian.
Nutster Posted September 14, 2005 Posted September 14, 2005 Take a look at the command DriveGetDrive as well. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
Hentie Posted September 14, 2005 Posted September 14, 2005 Func FindCD() $abc = "" $found = 0 For $i = 65 To 90 $abc = Chr($i) & ':\' $cdr = DriveGetType($abc) If $cdr = 'CDROM' Then $found = 1 Return $abc endIf Next If $found = 0 Then Return 'false' EndIf EndFunc ;==>FindCD ;Or $driveletter = stringleft(@scriptdir, 2)
GaryFrost Posted September 14, 2005 Posted September 14, 2005 Take a look at the command DriveGetDrive as well.<{POST_SNAPBACK}>As Nutster said this works just as well, this is from the help file$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]) Next EndIf SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now