I am writing a batch file to automate ghosting drives and running sid changer. I want to add a 5 second delay between the ghost program and the sid changer program and have the option to press any key to skip the sid changer. We don't need the sid changed on a win9x machine so this will allow us to skip it and go to the reboot.exe command. Here is what my batch file has so far. I have a simple choice command there for testing purposes right now, but I want the spacebar and enterkey and other special keys to be used to skip the sid program, actually, ANY key will skip the program.
@echo off
::running ghost
ghost.exe
::5 second pause with option to skip SID changer
choice.com /c:~0123456789qwertyuiopas
dfghjklzxc
vbnm /n /t~,5 Press any key to skip the SID Changer:
if errorlevel 1 set selchar=0
if errorlevel 2 set selchar=1
if %selchar%==1 goto end
::running the sid changer
sid.exe
:end
::rebooting machine
reboot.exe
How can I get any key to skip this? I don't HAVE to use the choice command. I just want something that says "Press any key to skip the SID changer..." with a 5 second timeout. If nothing is pressed it continues with the batch file and runs the sid changer. If ANY key is pressed, then it skips to the :end and runs reboot. I know I could have a choice of NT or Win9x in the choice.com command and have it default to NT and run the sid changer. I don't want them to have to think about it, just exit ghost and hit the spacebar or any key at all if it is a win9x machine. Can anyone help with this?
Thanks,
Traigo
Start Free Trial