alucard Posted April 19, 2005 Posted April 19, 2005 Hi, i want to know if it's possible to write a script who can detect if a drive exist? I see a function "fileexists" but not "driveexists" so .... thank you
buzz44 Posted April 19, 2005 Posted April 19, 2005 $var = DriveGetDrive( "all" ) If NOT @error Then MsgBox(4096,"", "Found " & $var[0] & " drives") For $i = 1 to $var[0] MsgBox(4096,"Drive " & $i, $var[$i]) Next EndIf That tell you want drives there are, you can then search the array for the drive letter your looking for. qq
alucard Posted April 19, 2005 Author Posted April 19, 2005 in fact i am an administrator, We have roaming user and they hort Help and they have got thinkpad.They have also station and they can plug their thinkpad on the station. the station have a drive of backup and i want make a script that can detect if the drive is here and if it's right that can copy user's data on this drive.
buzz44 Posted April 19, 2005 Posted April 19, 2005 (edited) $var = DriveGetDrive( "all" ) $drive = "a:"; Change it to your drive letter If NOT @error Then For $i = 1 to $var[0] If $var[$i] = $drive Then ; Copy data code EndIf Next EndIf You can change what DriveGetDrive() searchs for using "ALL", "CDROM", "REMOVABLE", "FIXED", "NETWORK", "RAMDISK", or "UNKNOWN" eg. DriveGetDrive( "REMOVABLE" ) will only search the removeable drives Edited April 19, 2005 by Burrup qq
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