Page 1 of 1

Convert vbscript to jscript

Posted: 27 Feb 2011 12:17
by josoline
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.

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

Re: Convert vbscript to jscript

Posted: 27 Feb 2011 13:40
by aGerman
josoline wrote:I know this is not a DOS batch question

Right. If you have a Batch-Question but there is no (good) solution for Batch we often try to help with other tools or languages.
Sorry but your question is realy off topic. You should ask your question in a programming or web-development forum.

Regards
aGerman

*** closed ***