Hi,
Does anyone knows why this command doesn't work?
Run(@ComSpec & " /c " & "devcon.exe hwids * | findstr /R ""1050&PID_0114&REV_0340&MI_01"" || (rundll32.exe user32.dll, LockWorkStation)", "", "")
This is the command in commandline:
devcon.exe hwids * | findstr /R "1050&PID_0114&REV_0340&MI_01" && (echo USB Device is connected) || (rundll32.exe user32.dll, LockWorkStation)
This works, but i want to convert this to AutoIT, but it doesn't work.
In short what i am trying to accomplish is that a script checks every 1 sec. if there is an USB device plugged in and if not ( so it is removed ) it will lock Windows OS.
Can someone help me with this?