English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

im workin on windows xp, i found out that "choice" command may solve my problem, but this command cannot be found in my system,"is not recognized as a int. or ext. command"
so which command and syntax i should use to enter data from user side to script side .......

2007-06-19 21:54:45 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

"set /p" is a good alternative, but you may want to include some prompt text. Like this,

set /p variable1=Enter variable1:

This will display "Enter Variable 1: " on the commandline and wait for the user to input some data, then store it in the "variable1" environment variable.


If you're looking for a simple way to do a "Yes or No" type function, then here's a little snippet to use,

============
@echo off
type nul>%temp%\~YesOrNo.tmp
echo Would you like to do this now [y/n]?
del /p %temp%\~YesOrNo.tmp>nul
if not exist %temp%\~YesOrNo.tmp goto Yes
Echo Selected "No"
del %temp%\~YesOrNo.tmp
goto end
:Yes
Echo Selected "Yes"
:end
==============

2007-06-20 14:07:14 · answer #1 · answered by Kevin 7 · 5 0

No, don't copy any files. Choice is limited to be used in autoexec.bat for whatever reason. The command you want is

set /p tempvar=

This will store the value entered at the keyboard into the environment variable tempvar for later use. Remember that these variabels are global, so name it something application specific.

If you have the time to learn it, I'd advice using VBScripts or perl, which provide a lot more in terms of flow control and such.

2007-06-19 22:10:47 · answer #2 · answered by Vox Sola 2 · 0 0

1. Run Notepad. 2. Type in the following: ipconfig /flushdns ipconfig /release ipconfig /renew 3. Save the file as a .bat file. 4. You can now run it by double click it.

2016-05-20 05:34:37 · answer #3 · answered by Anonymous · 0 0

take the "Choice" command from Windows 98 simply locate it (it is likely stored in C:\windows\command directory), send it to a floppy and then load it into the directory where you save your batch files in Windows XP.

2007-06-19 21:59:36 · answer #4 · answered by prasy 3 · 0 0

fedest.com, questions and answers