In Windows NT, we had to use tip 0323 to accomplish this.
In windows 2000, you can use the
SET /P variable=\[promptString\]
"The /P switch allows you to set the value of a variable to a line of input entered by the user. Displays the specified promptString before reading the line of input. The promptString can be empty."Here is a silly little example:
@echo off setlocal set OK=N :again set /p user=Please enter your User Name or END. if /i \[%user%\]\[END\] endlocal&goto end if \[%user%\]
\[\] goto again for /f "Tokens=*" %%i in ('net user "%user%" /domain') do call :parse "%%i" If "%OK%""N" goto again set /p xxx=Press any key to exit. endlocal goto end :parse set ustr=%1 if not "%ustr:~1,9%"
"Full Name" goto end set ustr=%ustr:"=% set ustr=%ustr:Full Name =% @echo Thank you %ustr% set OK=Y :end
0 comments
Hide comments