|
Answer» Is it possible in a DOS batch file to check if an application (Powerpoint) is already running.
Each day we DISPLAY a Powerpoint (.pps) show ONTO a Foyer located PC with DETAILS of the days visiors and other general information. I want to schedule a batch file to open the PowerPoint show at 10:00 if it is not already open.
I know I could include the kill process and start it, but is there acheck command?The command TASKLIST displays the programs (& services) that are running -- filter the output to see if powerpoint is there
Grahamgpl's approach should do it.
However here is another approach based on a suggestion from http://dostips.cmdtips.com/DtTipsCopy.php
It assumes that if a file is open then it can't be overwritten by the batch.
Code: [Select]set FILENAME=PowerPointFile echo.N|copy /-y NUL "%filename%">NUL&&( start /b "%filename%" ) echo.N|copy /-y makes sure that the ovrwrite operation will be aborted properly.
DOS IT HELP?
|