Convert vbscript to jscript

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Locked
Message
Author
josoline
Posts: 1
Joined: 27 Feb 2011 12:11

Convert vbscript to jscript

#1 Post by josoline » 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.

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Convert vbscript to jscript

#2 Post by aGerman » 27 Feb 2011 13:40

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 ***

Locked