Master.bat coding errors!

I am writing a script the executes .exes and .bats automatically, eliminating any humna error...

I have run into a snag, can anyone help?

@ECHO OFF

:: START install
start /wait install.exe

set /p _setupdir=What was the directory you specified in the INSTALL program? EG "C:\Program Files\Civ3" Make sure to use "" marks:

cd %_setupdir%

IF EXIST setup.bat (

:: START decom
start %_setupdir%\setup.bat

) ELSE (

echo incorrect directory.
echo try again.
)

:: Stop
set _setupdir=

pause

basically I want it to work kinda like this:

{run install.exe}

{ask what the dir was in the install file, answer is saved in a variable}

{if setup.bat exists in the dir location, execute setup.bat in that dir}
{if not, re ask question (loop but I dont know how)}

{clear variables}

{pause}

like I said, can anyone help?
[990 byte] By [Forgotten2] at [2007-11-19 14:57:36]
# 1 Re: Master.bat coding errors!
You may find this site ( http://www.allenware.com/icsw/icswref.htm) extremely useful!
HanneSThEGreaT at 2007-11-10 3:39:11 >
# 2 Re: Master.bat coding errors!
One big problem. Unless the install.exe outputs the directory of installation as a DOS variable, you are not going to be able to check to see if setup.bat exists. You will just have to predefine that location.
PeejAvery at 2007-11-10 3:40:10 >