Re: How to prevent task scheduler from starting a program already running



Hi,

Pegasus's message, in simple terms:

1) Start notepad (start -> programs -> accessories -> notepad)
2) copy the two lines below (which pegasus provided, except I've filled them
in a bit), into notepad:

@echo off
TaskList | find /i "Outlook" || "c:\Program files\microsoft
office\office10\outlook.exe"

3) In task scheduler, edit the current task (right-click, properties) and
look at the text in the 'run' box - it will look something like the last
half of the line we just copied into notepad. If it is different, then copy
and paste it from the run box into the notepad file. (If you have a
different version of Office to me, it will certainly be different)
4) save the file somewhere as outlook.bat (ensure you select 'All files' in
the 'files of type' option in the save dialog, or your file will be
"outlook.bat.txt" which we don't want)
5) Back in task scheduler, click the browse button and locate the
outlook.bat file you just created.

That should work. (Pegasus, feel free to correct anything if I've missed
something)

Basically, the batch file (outlook.bat) gets a list of currently running
processes (tasklist) and passes it onto the 'find' command which searches
for 'outlook' in that list. If it finds it, then the batch file stops
(because outlook is already running). Otherwise it runs Outlook.

Peter


"Nick Cumberbatch" <nickcwpg@xxxxxxxxxxx> wrote in message
news:um3wFBRzGHA.5072@xxxxxxxxxxxxxxxxxxxxxxx
I should have mentioned that my computer knowledge just a little more than
beginner.

Could you kindly interpret this for me in simple instructions

Thanks

"Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
news:uSklzmQzGHA.3908@xxxxxxxxxxxxxxxxxxxxxxx

"Nick Cumberbatch" <nickcwpg@xxxxxxxxxxx> wrote in message
news:%23kmJlRQzGHA.3908@xxxxxxxxxxxxxxxxxxxxxxx
I am using Windows XP Professional.

I have setup Task Scheduler to start Microsoft Outlook to run at 7 AM
each
day. However since I use the program often, I may sometimes leave it
running overnight. Then in the morning I find two instances of
Microsoft
Outlook running, the one that I started originally and the one Task
Scheduler started. How do I resolve this




Embed Outlook in a batch file like so:

@echo off
TaskList | find /i "Outlook" || c:\Program . . . . \ outlook.exe






.