Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Win32_ScheduledJob -- Windows 8

$
0
0

Hi Guys,

ScheduledJob doesn't works under Win 8 / 2012. We need it for some scripting stuff in our Domain. Powershell isn't a alternative!

We need it urgent, otherelse we can't support any new W8-Computer... :(

Any hints?

Regards

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" _& strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
    ("Notepad.exe", "********012500.000000-420", _
        True , 4, , True, JobId) 
If errJobCreated <> 0 Then
Wscript.Echo "Error on task creation - Error:" & errJobCreated 
Else
Wscript.Echo "Task created"
End If


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>