Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Open app in vbscript filter_list
Author
Message
Open app in vbscript #1
I made this code
Code:
strComputer = "."
Set wmi = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set wmiEvent = wmi.ExecNotificationQuery("select * from __InstanceOperationEvent within 1 where TargetInstance ISA 'Win32_PnPEntity' and TargetInstance.Description='USB Mass Storage Device'")
While True
Set usb = wmiEvent.NextEvent()
if usb.Path_.Class = "__InstanceCreationEvent" then WScript.CreateObject("Wscript.Shell").Run "msgHello.bat",0,True
Wend
It has a mistake "if...then" but I don't no how to fix it. Plz help me!

Reply







Users browsing this thread: 1 Guest(s)