Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to create a batchfile installer which runs an exe file which installs a programme on the PC & then installs a large number of files in a folder on the c:\ drive. It takes a number of minutes after the programme is installed for the files to be unpacked & appear in the new folder which it creates. I want the batch file to wait until the files have appeared before flashing a message to the user saying "Installation Complete".
I have tried the following:install.exe
:loopinst
if not exist c:\folder\index.htm then goto loopinst
echo Installation Complete
If the file doesn't exist then I get a "bad command or filename" error. If the file is there (i.e. rerun after installation) the process runs through ok, without thowing an error. It looks like the loop process isn't working, any ideas?Thanks,
Milkman

There is no THEN before a command in DOS batch-speak. It should read:
if not exist c:\folder\index.htm goto loopinst
Also, keep in mind install.exe will run to completion before instructions in loopinst are entered.

Hi,
I used to do similar things in batchfiles, if the check you are running is checking on the existance of a file or directory (or both, or multiple files) you can do something like this :
:start_chk
sleep 10
if exist file.exe goto inst_ok
goto start_chk
:inst_okThe 'sleep' command is not native DOS, if you look for it on i-net you will find it easily. But it will work without I guess, but then the program may be quite busy.
If this is what you are looking for .. otherwise, pls reply

You can replace sleep with choice
choice /N/T:y,#>nul where # is a number of seconds between 1 and 99
You might also want to add something like this before install.exe:
echo Now installing. This will take a few minutes; please be patient.

Thanks for the prompt replies.
The install.exe file has not completed by the time the batch file ends. In fact the exe file takes 2-4 mins to run depending on the spec of the PC. Also this makes it difficult to simply use a timer, hence the need to check for the appearance of a file.I'll take out the "then" & give it a try.
Once again thanks.
Milkman

All,
Thanks for the suggestions. What I have done is:
:loopxy
choice/n/t:y,20>nul
if not exist c:\folder\file.htm goto loopxyThis works fine, except for one thing.
If I run the installation exe file standalone it takes about 1:30 mins to install the programme & associated html files.
When I run the exe from the batch file & test for when the files are installed it runs for about 8 mins!! I have tried playing with the seconds value in choice but this makes little/no difference. It looks like the loop process is having a big overhead!! CPU runs flat out!!
Anyone any ideas how to reduce this?
What I ended up doing was
a: running the install.exe from start/w.
b: downloaded a prog called doze.exe (similar to sleep) & used this for the timing loop.Install time now down to original + 20secs (approx)
Once again thanks
Milkman

Hmm, to me this seems the 'timing' utility is eating some CPU
I experience somewhat the same, when I run my copy of sleep.exe in a similar way, maybe it is this .. Anyway, using 'choice' to get the waiting time is not a bad .. 'choice', after all, this is standard window. Do try some version of sleep.exe as well
And what you can also try, is just using the same code, but without the 'wait' command whatever you are using ...
Try to determine where exactly the program is running slow

I don't see why this wouldn't do it:
START /w install.exe
echo Installation Complete-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
can't boot to dos
|
Booting dos in winme
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |