# Check if Program is running and execute with batch file



## ScreenShot (Jan 4, 2007)

Hi
A few days ago someone has the same question as i do. And also the solution was given by Chicon , thank you for that. :up: 


@ECHO off

:BEGIN

%SystemRoot%\Test\pv.exe -d10000

%SystemRoot%\Test\pv.exe > result.txt

FIND "spider.exe" result.txt
IF ERRORLEVEL 1 START %SystemRoot%\system32\spider.exe

GOTO BEGIN


Now comes my question:
What if an .exe program starts with a dialogbox with only the buttons Start and Stop in it.
How is it possable to "click" on the start button with DOS code.
The example above is Spider Solitaire , it has 3 radio buttons , an OK button and a Cancel button, I am only interesting in the OK button.


Thanks.


----------



## Chicon (Jul 29, 2004)

Hi ScreenShot,

Welcome to TSG ! 

Personally, I do not know Spider Solitaire but some applications accept parameters either they are launched from a shortcut or a DOS batch. Also, other applications use the parameters generally stored in their .INI files.
In your case, the trick would be to know wich parameters the process 'spider.exe' accept in order to force the 'Ok' button or to skip the dialog box or which parameter must adapted in the .INI file.
Unfortunately, I can't answer you about the way Solitaire Spider can be launched the way you wish.


----------



## ScreenShot (Jan 4, 2007)

Hi

The cardgame "Spider" was just an example so you could try it out. I thought "Spider" was installed on any xp-machine by default ,it opens full screen and then a small dialogbox appears with some buttons.

So thanks anyway for your time.


----------

