ahmed9100 Posted May 4, 2010 Posted May 4, 2010 hello i trying to make a mini antivirus for usb storage device so i need the script to detect any usb mass storage plugin to my computer !
Shafayat Posted May 4, 2010 Posted May 4, 2010 DriveGetType() returns the type of drive. Usually a removable device with a drive letter is a mass storage device. (consult the help file) If you want to be notified when a device is entered, you can create a hook. There is an example in the Example Scripts forum. Search and your should find it. [Not using this account any more. Using "iShafayet" instead]
ahmed9100 Posted May 4, 2010 Author Posted May 4, 2010 i have used this code but sometime it didn't detect the usb storage Func getdriver() $var = DriveGetDrive( "all" ) If NOT @error Then ;~ MsgBox(4096,"", "Found " & $var[0] & " drives") For $i = 1 to $var[0] $var2 = DriveGetType( $var[$i] & "\" ) $var3 = DriveStatus( $var[$i] & "\" ) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\miniantivirus\drivers\" & $i ,$i,"REG_SZ",$var[$i] & "\") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\miniantivirus\drivers\" & $i ,"type","REG_SZ",$var2) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\miniantivirus\drivers\" & $i ,"statue","REG_SZ",$var3) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\miniantivirus\drivers\count" ,"dcount","REG_SZ",$i) Next EndIf EndFunc
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