Starting and Stopping NT Services with ADSI,wsh, and VBScript 
Author Message
 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.



Fri, 15 Feb 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Start/Stop a NT Service using wsh/adsi

2. Start/Stop a NT Service using wsh/adsi

3. Start/Stop a NT Service using wsh/adsi

4. Starting and Stopping NT Services from WSH/VBS

5. How to start/stop a NT service

6. Stop and Starting Services on NT

7. Starting and stopping NT services

8. How to start/stop a NT service...

9. Script To Stop/Start NT Service

10. Stopping and Starting NT Services

11. Stopping and Starting NT Services

12. Stop/Start NT Services

 

 
Powered by phpBB® Forum Software