| 1. |
Solve : choice.com question? |
|
Answer» I'm using "choice" in a batch file, similar to this: If this isn't possible with choice, is there something else that will do this?With a Win9x machine (CHOICE is not available on NT machines), you might be able to do something with a Windows Script. Just what are you trying to do? Hope this helps. This is a separate batch file I'm calling from autoexec.bat on win98. It overwrites the system.dat, user.dat, and a growing list of key system files and folders from copies on a CD. It runs automatically at each system reboot unless a certain keystroke is made. No screen display of the choices. This is PART of a bigger project using an "alternate registry" that gets overwritten during reboot. I did try putting multiple entries in for one of the choices, something like: CHOICE.COM /N /C:1[234567890qwertyuiop] /T1,5 The letters and numbers worked but the batch had problems when I added other characters. Could "IF" be used to handle to an invalid entry? Rick At first, a good solution might have been escaping special characters, but CHOICE only allows single character choices. Some special characters (/, \, &, and others) are used by DOS itself, which would probably CREATE some interesting but unexpected results. You could try writing a QBASIC program. Good luck. I don't know anything about QBASIC or any other programming language. That will have to wait until I have more time. I experimented with that batch file a little more and got some encouraging results. The first part looks like this: @echo off CHOICE.COM /N /C:1234567890qwertyuioplkcjhgfdsazxvbnm`[emailprotected]#$^&*()-=_+[]}{;:'",.? /T2,5 IF ERRORLEVEL ==2 GOTO TWO IF ERRORLEVEL ==1 GOTO ONE Written this way, any of the keys above default to "2" except for "1" which works as I wanted. The only keys I couldn't add to it are: \|%>< Not quite what I wanted, but it will get the job done. I do have another question for you. The rest of this batch file makes extensive USE of the copy and xcopy commands. Can the be used so that there is no output on the screen? I'd like to get rid of the "1 file(s) copied" and similar messages on the screen so that there are no indications that this is running. Rick Glad to see you got it worked out. Code: [Select] copy source target > nul xcopy source target > nul I don't know how much material I've looked at, but none of it explained > nul. That works great. Now I just need to go back thru this thing and double check all the paths and filenames. That and one more system backup just to make sure. Thanks again. Rick |
|