Convert vbscript to jscript
Posted: 27 Feb 2011 12:17
I know this is not a DOS batch question but I received help before with vbscript through this form so here I am.
I'm looking for a simple conversion for this client side script from vbs to js
Any help is appreciated thanks.
I'm looking for a simple conversion for this client side script from vbs to js
Any help is appreciated thanks.
Code: Select all
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _
& "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
& "TargetInstance.GroupComponent= " _
& "'Win32_Directory.Name=""c:\\\\scripts""'")
Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo objLatestEvent.TargetInstance.PartComponent
Loop