1.

Solve : batch file to close program?

Answer»

Hi, I NEED to have a program (MS Outlook) close at a certain time if it's open. Is there a way to write a batch file to quit the program if it's open or exit and do nothing if it isn't open? As far as the certain time, I can schedule the batch file run automatically in the Scheduled Tasks whenever I WANT. How would I go about the batch file?

THANKS.assuming XP and outlook program name is outlook.exe
you can use taskkill.exe http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/taskkill.mspx?mfr=true

example only:

taskkill /im outlook.exe /fThank you!

That worked perfectly. The problem I had was that when Outlook remained open on that workstation, our daily backup would fail. Now it looks LIKE it will be fine.

Actually, it solved two problems at once. We'd had trouble with our spam filter plug-in not filtering out spam because when we closed Outlook with the X, the plug-in would terminate, but the OUTLOOK.EXE process wouldn't terminate. Consequently e-mails would still come in that wouldn't get filtered.

But, the Outlook process will kill automatically now and solve this and my first problem.

Thanks.



Discussion

No Comment Found