Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!




By dp_kaplan ·
I need help in writing a script to schedule the following on a Win XP Pro
1. End a running application
2. Start a second application
3. When the second application ends start the first application again.



This conversation is currently closed to new comments.

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

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

echo No initial process to kill
goto finish

start /wait notepad.exe
start winword.exe



Related Discussions

Related Forums