General discussion

Locked

Stopping Services from Command Line

By sgandenberger ·
In Windows 2000 and/or NT 4.0 is there a way to stop and start services with command line stings that could be called by an AT
Command? I have a service that is interfering with a VeriTas BackupExec backup. I would like to stop the service beforethe backup is scheduled to run, and then start it after the backup has completed.

This conversation is currently closed to new comments.

10 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Stopping Services from Command Line

by LiQuiDKeWL In reply to Stopping Services from Co ...

Yes there is.
at command prompt type in :
NET STOP <service>

That should stop it for you

To start it type :
NET START <service>

Cheers ....

Collapse -

Stopping Services from Command Line

by LiQuiDKeWL In reply to Stopping Services from Co ...

Just an example. Like stopping WINS :
NET STOP WINS

To Start it up again
NET START WINS

:-)

Collapse -

Stopping Services from Command Line

by Shanghai Sam In reply to Stopping Services from Co ...

Poster rated this answer

Collapse -

Stopping Services from Command Line

by SyscoKid In reply to Stopping Services from Co ...

The previous answer is correct. Just to expand, you would then write a bat file to stop the service, and another one to start the service, and use the AT command to run the bat files.

Collapse -

Stopping Services from Command Line

by Shanghai Sam In reply to Stopping Services from Co ...

Poster rated this answer

Collapse -

Stopping Services from Command Line

by mebudman In reply to Stopping Services from Co ...

for some of the services you will need to enclose them in quotes such as
net stop "microsoft dhcp server"

just some clarification

Collapse -

Stopping Services from Command Line

by Shanghai Sam In reply to Stopping Services from Co ...

Poster rated this answer

Collapse -

Stopping Services from Command Line

by BasicIT In reply to Stopping Services from Co ...

While technically correct the previous answers might not address your need if the server want the services stopped on is a remote server. the net stop command for services only work for local machine. for those to work you would need store the bat file on the remote server and call an AT command from your backup server. (If using Veritas BE 8.x use the Run Before box in Job Properties)
OR (the easy way)
use the NT Resource Kit command NETSVC.
write a batch file (svrstop.bat) and sore it on backup server and call it from Job Properties. To start services after the job completes write batch to start services and call it from the run after dialog box.

The command syntax is
Controls and displays the status of services.

NETSVC servicename \\computername /command

servicename Name of the service
computername Name of the computer to administer.

/start Starts the service.
/stop Stops the service.
/pause Pauses the service.
/continue Starts the paused service.Example: NETSVC server \\joes486 /query
Example: NETSVC "Clipbook Server" \\popcorn /stop
Example: NETSVC alerter \\joes486 /pause
Example: NETSVC /list \\joes486

Arguments are allowed in any order.

Collapse -

Stopping Services from Command Line

by sgandenberger In reply to Stopping Services from Co ...

This question was closed by the author

Collapse -

Stopping Services from Command Line

by NetTek In reply to Stopping Services from Co ...

While the above information is helpful, no one has told you how to find the syntax of a specific service. For example, to start the Microsoft Exchange Information Store from a command line, you would use
NET START MSEXCHANGEIS

If you would liketo know what syntax to use to start VeriTas BackupExec, there are two places you can look. Run REGEDIT and navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

You will see a list of folders under the Services folder. The name of each of these folders is the syntax you would use to start or stop that particular service.

Service syntax can also be found by navigating to
HKEY_LOCAL_MACHINE\SOFTWARE

Highlight SOFTWARE, and do a search for "servicename". This will also lead you to the syntax used to start a service.

If the service has a space in the name, you need to put quotations around it in the NET command.

Back to Windows Forum
10 total posts (Page 1 of 1)  

Related Discussions

Related Forums