Stopping NT Services 
Author Message
 Stopping NT Services

I am trying to figure out how to stop an NT Service.  What I actually need
to do is Stop and re-start a service on a remote NT system.

I put together the following program, but it fails on:
        Set ComputerObj = GetObject(SystemService, Computer)

the followng error codes are returned (and I couldn't find what they mean):
        Line:    13
        Char:    1
        Error:    0x800708AC
        Code:    800708AC
        Source:  (null)

Here is the code that I am using:

----------------------------------------------------------------------------
-
dim sLF, sMsg, sTab, ComputerName, ServiceName, myObject

' Set variables
ComputerName = "DAVIDG"
ServiceName = "Netscape Admininistration Server 3.5"
SystemService = "WinNT://" & ComputerName & "/" & ServiceName
sLF = Chr(13)
sTab = Chr(9)
sMsg = ""

' Stop Service
Set ComputerObj = GetObject(SystemService, Computer)
ComputerObj.stop
Set ComputerObj = Nothing

' Inform user service has stopped
sMsg = "Service Stopped:" & sLF
sMsg = "Computer:" & sTab & ComputerName & sLF
sMsg = "Service:" & sTab & ServiceName & sLF
DoneMsg = MsgBox(sMsg, _
    vbOK + vbInformation, _
    "Service Stopped")
 ---------------------------------------------------------------------------
--

Can anyone help me?

David Genrich



Wed, 19 Dec 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Starting and Stopping NT Services with ADSI,wsh, and VBScript

2. Stop NT Service

3. Starting and stopping NT services

4. Starting and Stopping NT Services from WSH/VBS

5. Starting/Stopping NT Services

6. How to start/stop a NT service

7. Stop and Starting Services on NT

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

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

10. Script To Stop/Start NT Service

11. Stop services on NT Server

12. Stopping and Starting NT Services

 

 
Powered by phpBB® Forum Software