bird42 Posted January 22, 2009 Posted January 22, 2009 i want to make a script which detects i f a drive is plugged in... can u help me?
Inverted Posted January 22, 2009 Posted January 22, 2009 ?? There is a whole family of drive-related functions. Read the help ? Especially DriveStatus seems suited to your needs.
bird42 Posted January 22, 2009 Author Posted January 22, 2009 i alredy know drive related functions but i don't want to write a loop such this: while 1 $var = DriveGetDrive( "REMOVABLE" ) For $i = 1 to $var[0] ;do something next EndSelect WEnd i need a script like this repeat sleep(100) until a usb is plugged
Authenticity Posted January 22, 2009 Posted January 22, 2009 (edited) From G. Born's press ; Drive type constants Const Global Unknown = 0 Const Global Removable = 1 ; Removable medium Const Global Fixed = 2 ; Fixed medium (hard disk) Const Global Remote = 3 ;Network drive Const Global CDROM = 4 ; CD-ROM Const Global RAMDisk = 5 ; RAM disk Dim $fso, $oDrive, $Drive $fso = ObjGet("Scripting.FileSystemObject") $oDrive = $fso.Drives For $Drive In $oDrive Switch $Drive.DriveType Case Unknown ..... Case Fixed ..... EndSwitch Next ;... by G. Born Edited January 22, 2009 by Authenticity
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