Computer Hope
Microsoft => Microsoft DOS => Topic started by: Xenfire on April 29, 2009, 06:38:10 PM
-
Is there a possible way to ask for user input, but if they take too long to input, the script would continue?
Example
@echo off
echo Enter something here.
set /p a=
(if 3 seconds pass and nothing has been written, continue with script)
*commands*
Help?
-
Is there a possible way to ask for user input, but if they take too long to input, the script would continue?
Example
@echo off
echo Enter something here.
set /p a=
(if 3 seconds pass and nothing has been written, continue with script)
*commands*
Help?
Choice.exe can acomplish ths Jakob. (Download from CH Downloads section)
Edit: Although every computer that the batch script will be on must have choice.exe (or .com) on it.
-
*censored* you
what would I write.
-
This may clear it up:
@echo off
:main
choice /C:YN /T:N,3 Would you like to enter something
if ERRORLEVEL 2 goto entercmd
<your commands here>
goto end
:entercmd
set /p input=Enter something:
goto main
:end
exit
That help?
-
This may clear it up:
@echo off
:main
choice /C:YN /T:N,3 Would you like to enter something
if ERRORLEVEL 2 goto entercmd
<your commands here>
goto end
:entercmd
set /p input=Enter something:
goto main
:end
exit
That help?
Yes, thank you.
-
Yes, thank you.
If you are planning to use that where I think you will want to use that, you need to know that choice.exe (or .com) must be included with the script, because where I think you want to use it does not have choice.exe or choice.com .
-
Very true, Helpmeh.
Xenfire for an NT version(Win2K, XP, and Vista) of Choice use this:Link (http://ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/SCRPTING/CHOICE.EXE)
If you have an OS older than Win2K, then CHOICE.COM is probably on there already.
-
Very true, Helpmeh.
Xenfire for an NT version(Win2K, XP, and Vista) of Choice use this:Link (http://ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/SCRPTING/CHOICE.EXE)
If you have an OS older than Win2K, then CHOICE.COM is probably on there already.
The OS for what I'm about 99% sure he's thinking of putting it on is XP Pro. Although there is like a 0.0001% chance that the Admins put it on...even though that would be completely stupid...
-
Yea, and if he had Windows 2003 he wouldn't need to download it, it comes with it.
-
Yea, and if he had Windows 2003 he wouldn't need to download it, it comes with it.
I'm not sure what OS he has at home...but what I'm fairly sure he will be doing with it will not be used at home...
-
True, Windows 2003 is more or less used as a Server OS, not really intended as a Home OS.
-
Just looked, he has WIN XP (so does where the script will probably be put into affect)...so choice must be included...
-
Not necessarily, I have Win XP Pro and choice isn't on mine.
-
Not necessarily, I have Win XP Pro and choice isn't on mine.
Choice must be INCLUDED...as in with the script package.
-
What service pack do you have?
I have SP3
-
What service pack do you have?
I have SP3
SP2...I can't get SP3
-
Interesting...wonder why they cut out Choice in SP3....
Oh well.
-
Interesting...wonder why they cut out Choice in SP3....
Oh well.
It's not in SP2.