Discussion Locked

creating a batch file

0 helpful
17 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am running Veritas Backup software 8.6 on a W2k server. I am using McAfee Groupshield to backup my exchange mailboxes. I need to stop 2 of these services before my backup will run properly. To do this I need to create a batch file to stop the service before and after the backup is done. What is the correct syntax to stop a service running on a difference server? or can this even be done?

17 replies

by maxwell edison

Just as you can start a service with the "net start" command, you can stop the service with "net stop".

From the command line, execute net stop

Maxwell

by memg

I know that I can start and stop a service with net start and net stop but can I put this in a batch file on one server to stop it on another server. In other words I am stopping a service on a different server from the backup server

by madroxxx

I believe you could create the batch file on the other server and use scheduler to initiate it from the backup server.

by ian mclaws

The easiest way administratively, to do this is to create a single batch file as though it were being run locally, and then use the FRS (file replication service) to spread it to all your systems. Also, with Active Directory, you can use a GPO to mass-schedule a defrag routine. The advantage of doing it this way is that the batch file remains very simple, and yet is automatically updated throughout your system when any changes are made.

Let me know if you need some more help, and good luck.
Ian

by ian mclaws

Should have mentioned, if you use AD to push the defrag as a GPO, just push three scheduled tasks, a batch file that stops the services, then the defrag, then another batch that re-starts the services.

Ian

by maxwell edison

The Microsoft Windows NT Server 4.0 Resource Kit Supplement 4 includes a script named service.vbs that lets you start or stop a service remotely.

For example, to shut down the DHCP server service on a remote machine named \charlie and restart the service, you could execute the commands

cscript service.vbs /x /n dhcpserver /s charlie
cscript service.vbs /g /n dhcpserver /s charlie

Actionoption can be:

/g to start a service
/x to stop a service
/r to remove a service
/d to list a service's dependencies.

See this Windows .Net Magazine article for elaboration on the aforementioned commands as well as other commands that will allow you to reach across a network to manipulate various services.

http://www.win2000mag.com/Articles/Index.cfm?ArticleID=8962

REMOVE SPACES from the pasted URL.

Good luck,

Maxwell

by joseph moore

Personally, I like using SC.EXE from the Resource Kit. It is a command-line tool that will let you stop/start/pause a service on a remote machine. And scripting it in a BAT file is easy. For example, to stop two services names "groupshield1" and "groupshield2" on the machine called SERVERNAME, then run Backup.exe, then start the services back up, the BAT file would contain the following:

@echo off
SC.EXE \\SERVERNAME stop groupshield1
SC.EXE \\SERVERNAME stop groupshield2
Backup.exe
SC.EXE \\SERVERNAME start groupshield1
SC.EXE \\SERVERNAME start groupshield2

Just put SC.EXE and the BAT file (STOPGROUPSHIELD.BAT for example) in the same directory on whatever machine you want.
That is all.

hope this helps

by rabbit_runner

Hi, If you are running Veritas 8.6, why not install the OFO (Open File Option) and the Exchange Agent. They are on the install cd for Veritas. This way, you will NOT need to stop any services. We are using this quite successfully and are getting good backups of our Exchange 5.5 server with all mail boxes.

If you want more information, let me know and I will be more than glad to help.

by m.r.

In relation to answer 6 - I think he already has the Exchange agent or he wouldn't be getting the mailbox option. Also these options need a license to install. Like you though we are running the Exchange agent along with McAfee and it works fine although I did see the warnings on the Veritas site about it. I think the previous answers are good just adding a note: You may want to stop your IMC if you are killing your antivirus protection.

This discussion is closed to new replies.