LowKey Posted January 9, 2008 Posted January 9, 2008 I currently have a script that runs with autorun, that causes the drive's background picture and text colour to change using the Desktop.ini file, then opens the drive with run("explorer.exe e:"). I was wondering, first off, if and how can I automatically determine the drive letter? Secondly, is there a better/more efficient way to open the drive? ~T3CHM4G3~PROjECTS: Telnet Client
Danny35d Posted January 9, 2008 Posted January 9, 2008 $USB_Drive = StringLeft(@ScriptDir, 2) Run(@ComSpec & ' /c Explorer ' & $USB_Drive, @ScriptDir, @SW_HIDE) AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Xenobiologist Posted January 9, 2008 Posted January 9, 2008 Hi, ??? MsgBox(64, 'ScriptDrive', _getScriptDrive()) MsgBox(64, 'ScriptDrive mit "\"', _getScriptDrive(1)) MsgBox(64, 'ScriptDriveType ', _getScriptDriveType()) Func _getScriptDrive($iflag = 0) Local $drive = StringRegExp(@ScriptDir, '[a-zA-Z]\:', 1) If @error <> 0 Then Return -1 If $iflag = 0 Then Return $drive[0] Return $drive[0] & '\' EndFunc ;==>_getScriptDrive Func _getScriptDriveType() Local $drive = StringRegExp(@ScriptDir, '[a-zA-Z]\:', 1) If @error <> 0 Then Return -1 Switch DriveGetType($drive[0]) Case "Unknown" Return 1 Case "Removable" Return 2 Case "Fixed" Return 3 Case "Network" Return 4 Case "CDROM" Return 5 Case "RAMDisk" Return 6 EndSwitch Return -1 EndFunc ;==>_getScriptDriveType So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
slayerz Posted January 14, 2008 Posted January 14, 2008 (edited) @Low Key, from what I can understand is, you want your script to automatically determine the drive to open your USB drive rite?I have a simple solution for this...Well, I do write batch script like this :START /max explorer.exe %removable%\save it as anyname.bat, put it in your USB drive, it should automatically open your USB drive when executedBTW, that's only my basic idea.You could write it in autoit using _rundos() Edited January 14, 2008 by slayerz AUTOIT[sup] I'm lovin' it![/sup]
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