IsNull
Joined: 10 May 2007 Posts: 64 Location: .switzerland
|
Posted: Wed Feb 06, 2008 8:25 am Post subject: |
|
|
| Code: |
#Noenv
#Persistent
DriveGET, OutVorhanden, List, REMOVABLE
settimer, check, 100
return
check:
ret := scan4newDrives(OutVorhanden)
if (!ret){
;nothing here
}else{
msgbox Found new device! : %ret% ;here you can add code, wich should be executet if a new USB Device is plugged in.
}
return
scan4newDrives(byref olddrives){
DriveGET, OutAktuell, List, REMOVABLE
Loop, parse, OutAktuell
{
if InStr(olddrives, a_loopfield) {
;still here
}else{
;found new device!
olddrives := OutAktuell ;update
return, % a_loopfield
}
olddrives := OutAktuell ;update
return, 0 ;no new devices found.
}
}
|
I've postet this code in the german Forum... _________________ http://securityvision.ch
 |
|