crpytocrzy
Technical User
Hi All,
I have the below to start the spooler service if not running , I would like to create logfile to write out a file everytime its runs.
Any help would be appreciated. I am a complete beginner so please take it easy
Set wmi = GetObject("winmgmts://./root/cimv2")
qry = "SELECT * FROM Win32_Service WHERE Name = 'spooler'"
For Each svc In wmi.ExecQuery(qry)
If svc.State <> "Running" Then svc.StartService
Next
I have the below to start the spooler service if not running , I would like to create logfile to write out a file everytime its runs.
Any help would be appreciated. I am a complete beginner so please take it easy
Set wmi = GetObject("winmgmts://./root/cimv2")
qry = "SELECT * FROM Win32_Service WHERE Name = 'spooler'"
For Each svc In wmi.ExecQuery(qry)
If svc.State <> "Running" Then svc.StartService
Next