Home > Scripts, Windows, Windows Server > Shutdown and Restart Application Script

Shutdown and Restart Application Script

This is a script to shutdown and restart an application (i.e. jboss) on windows.
It also renames the application generated log file(s).

taskkill /f /t /fi “WINDOWTITLE eq 3 Scheduler”

for /F “tokens=1,2” %%d in (‘date /T’) do set day=%%d & set date=%%e
set yyyy=%DATE:~6,4%
set mm=%DATE:~3,2%
set dd=%DATE:~0,2%
set dateserial=%yyyy%-%mm%-%dd%
ren “D:\logs\scheduler\scheduler.log” %dateserial%-scheduler.log

start /min “3 Scheduler” cmd /c “D:\scheduler\bin\run.bat”

Exit

-Eric

Note: I found the base script from here

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: