ahmed9100 0 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 ! Share this post Link to post Share on other sites
Shafayat 3 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] Share this post Link to post Share on other sites
ahmed9100 0 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 Share this post Link to post Share on other sites