Script
I need help in writing a script to schedule the following on a Win XP Pro
workstation:
1. End a running application
2. Start a second application
3. When the second application ends start the first application again.
Thanks,
David
Software
I need help in writing a script to schedule the following on a Win XP Pro
workstation:
1. End a running application
2. Start a second application
3. When the second application ends start the first application again.
Thanks,
David
by dp_kaplan Accepted solution
by bizzo Accepted solution
Firstly download PsTools from sysinternals and extract pskill.exe
http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx
And here's the batch file, you can replace the applications winword.exe and notepad.exe. It's written so if the first application doesn't exist, or if the first app cannot be stopped, it doesn't start the second.
So here it is:
-----------------------------------
@echo off
pskill winword.exe
if errorlevel 0 goto :kill1
if errorlevel -1 goto :nokill
goto :finish
:nokill
echo No initial process to kill
goto finish
:kill1
start /wait notepad.exe
start winword.exe
:finish
-----------------------------------
This discussion is closed to new replies.
Sort by Trending