
Starting and Stopping NT Services with ADSI,wsh, and VBScript
I have a question-
If you want to stop services for Web Services using a batch file and
you are trying to stop a service that has other services dependent upon
it, you would simply append the "net stop" command with a forward
slash "/y" which then stops all the dependent services.
For example:
net stop "Microsoft SMTP Service"
net stop "IIS Admin Service" /y
net stop "Content Index"
How do I do that with Windows Scripting Host and ADSI? I'm getting
errors because the IIS Admin Service has 3 other services that depend
on it (Web, FTP, and SMTP).
Set objIISADMIN = GetObject("WinNT://ComputerName/IISADMIN")
objIISADMIN.stop
Set objIISADMIN = Nothing
Any advice? I know I can check the states of the services, but I'd like
to find an easy way to pass a parameter like in a .bat file.
Thanks!
Hutch Craig
Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.