Restarting services through scripts

Posted: July 13, 2010 in Uncategorized
Tags: ,

Save the following text as a batch file. Copy the text in a notepad and save it as script.bat.

To execute the batch file, simply double click it. This will:-
1. Stop the iis service
2. Stops the Coldfusion version 8
3. Kills Coldfusion’s dependency services
4. Starts Coldfusion
5. Starts the iis service.
————————————————————————–
iisreset /stop

net stop “ColdFusion MX 8 Application Server”
net stop “ColdFusion MX 8 ODBC Agent”
net stop “ColdFusion MX 8 ODBC Server”
net stop “ColdFusion MX 8 Search Server”

kill -f swagent.exe
kill -f swstrtr.exe
kill -f jrun.exe
kill -f jrunsvc.exe
kill -f swsoc.exe
kill -f java.exe

net start “ColdFusion MX 8 Application Server”
net start “ColdFusion MX 8 ODBC Agent”
net start “ColdFusion MX 8 ODBC Server”
net start “ColdFusion MX 8 Search Server”

iisreset /start
————————————————————

Also Run -> services.msc -> right click a service and select dependencies and choose restart [after 1 or 2 minute]. This automatically restart the service in the server when its down.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s