Question

Locked

Script

By dp_kaplan ·
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

This conversation is currently closed to new comments.

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

All Answers

Collapse -

This will work for you

by Bizzo In reply to Script

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

-----------------------------------

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums