Wait command for DOS

BuisyBizz

Limp Gawd
Joined
Jun 17, 2002
Messages
445
I'm making a bootable dvd, which will automatically load an image to a computer. I want to wait a few seconds from the time the user chooses to load the image before actuallying issuing the command to ghost to load the image without further interuptions. However, there is no wait command in dos, and the sleep.exe from the windows server resource kit cant be run in dos. I came across two sites that said
If you want to implement the WAIT command, create the following batch file and name it WAIT.BAT.

@CHOICE /T:N,%1% > NUL

Now, in order to wait 10 seconds in a batch file, just call the WAIT.BAT batch file as follows:

CALL WAIT 10
I did that, but DOS reports "bad command or filename"

Anyone know of another way?

Thanks.
Bizz
 
Lord of Shadows said:
http://www.computerhope.com/dutil.htm - little sleep app should do the trick
I downloaded the app, and it works fine in windows, however, it does not work in dos 6.22. It gives the error "This program cannot be run in DOS mode." You think the fact that i'm using the dos 6.22 boot disk from bootdisk.com has something to do with this?
 
Howdy. N00b here...I have a bootable USB key and need that delay program for my ASCII messages during AUTOEXEC.BAT boot. Any updated location would be appreciated??? Many thanks!
 
He asked for the sourcecode a while ago, (I didnt want to post it then, but why not now) still in my pm, so I'll recompile it with the trust outdated turbo c compiler thats free on the net.

I'll keep this link up forever though (or untill I change isps)
delay.zip

And here's the source code in my pm, nothing a first semester programming student couldnt do, feel free to berate me for the loop. ;o)
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(int argc, char *argv[])
{
	time_t	delay;	/* time_t is just a long int */

	if (argc != 2)
	{
		printf("Usage: %s <delay in seconds>\n", argv[0]);
		return 0;
	}
	delay = time(NULL);
	delay += atoi(argv[1]);
	while (delay > time(NULL)); /* Will cause 100% cpu, but doesnt matter much in msdos */
	return 0;
}

Edit: I'll look about for a better solution, conio might have something better.
 
I usually use "ping" to do delays in XP batch files, because "choice" is no longer supported and "wait" is not a native command. You could also just use "pause" if you don't mind pressing a key.

A quick Google search revels this site including a download of a wait command:
http://home.mnet-online.de/horst.muc/horst.htm
I haven't tried it, but it looks like it fits the description.
 
Hahaha, Lord of Shadows, that's disgustingly simple and awful and hilarious at the same time! :D

I demand someone use .NET to do this in a 1.2MB application that requires both NET framwork 1.1 and 2.0 to be installed (something I still do not understand to this day). ;)
 
I found something called delay() in dos.h, I'll give that a shot in a second. Little hard to make use of turbo c when switching between xp64 and the ever in use laptop.

(sounded good, but doesnt appear to work as it is suppose to)
 
Gentlemen: I thank you.

I report back: all is good. The DELAY.EXE works very good on my bootable USB key. It allows me to tell people that the client is still rebooting (bootwarm.com) until the server finishes booting (taking forever to check the 1.5TB RAID) and provides a source for the Network boot.

Thanks again for your help!

[me bowing]

Aloha and Mahalo,
roognation
 
Back
Top