Please, how to run a macro when someone connects a USB stick to PC ?
Greetings,
Reimon.
How to run a macro when someone connects a USB stick to PC ?
Moderators: JRL, Dorian (MJT support)
Try This:
Code: Select all
VBSTART
Function CountUSBDrive()
on error resume next
Dim USBCount
USBCount = 0
Set fso = CreateObject("Scripting.FileSystemObject")
Set oDrive = fso.Drives
For Each curDrive In oDrive
if curDrive.DriveType = 1 Then
USBCount = USBCount + 1
End if
Next
CountUSBDrive = USBCount
End Function
VBEND
VBEval>CountUSBDrive,OldUSBCount
Label>CheckAgain
VBEval>CountUSBDrive,USBCount
//MessageModal>USBCount
If>USBCount>OldUSBCount
MessageModal>New Drive Detected
//A new removable drive has been detected
//Do more code here
Else
Wait>0.01
Goto>CheckAgain
Endif
or you could have it detect when the bubble pops up using getpixel or image recognition that the new drive is plugged in his way is already coded thopugh
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!