Any service can be manipulated with the WMI, if installed:
http://www.*-*-*.com/
Consider this script, to reboot the macnine ( remove the file: from the /root./cimv2)
----RebootIt.VBS---
Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}" & _
"file://./root/cimv2").ExecQuery("SELECT * FROM " & _
"Win32_OperatingSystem WHERE Primary=true")
ianswer = MsgBox("Reboot Windows?", _
vbYesNoCancel, "Reboot")
If ianswer = vbYes Then 'If Yes force reboot
For Each OpSys In OpSysSet
outParam = OpSys.Win32Shutdown(2)
Next
If err.number <> 0 Then
WScript.echo "Error number: " & Err.Number & _
vbNewLine & "Description: " & Err.Description, vbCritical
End If
Else ' user selected cancel
WScript.echo "Operation canceled"
End If
--end file---also attached--
--
Mark L. Ferguson Please reply in Newsgroup
marfers notes for OE 5.0 > http://www.*-*-*.com/
Quote:
> Is it possible to stop and then restart IIS from a script using WSH?