Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello.
My problem is exact like the problem "making a .bat file to get input" in DOS\Page 1...
BUT it is in NT 4.0. Like the answer from Secret_doom....but like he sayes, "There are other methods to get user input om such OS's. Please help me..../jonas

Here I am!
Well, the methods for that issue differ a lot from OS to OS. I have 3 basic methods, one of them specific to NT4 (and perhaps under), since SET/P won't work on it, like on Win 2000 and XP. Here's it:
@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=> %temp%.\input.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>> %temp%.\input.com
echo @]yI?@xAp~sA`LZNt@x[}?MGI@]A?nsl@]}G@tLC?sBZ`LBL`_jN0xxxxx>> %temp%.\input.com
for /F "tokens=*" %%I in ('%temp%.\input.com') do set INPUT=%%I
del %temp%.\input.comThat method, which uses a little assembly code, is also compatible with Win 2K and XP, but not with Win9x and DOS (actually the asm is compatible, but the FOR cmd to handle the output isn't).
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br__________________________________________________________________________________________

Hello again secret_doom.
Sorry to bother you again. But i don't get the file to work. Here is the Problem, it look's like this.
@echo off
echo.
echo [Jonas Backupmenu]
echo.
echo ++++++++++++++++++++++++++++++++++++++
echo + 1. Userdata Backup Trough Choice +
echo + 2. Quit +
echo ++++++++++++++++++++++++++++++++++++++
echo.
CHOICE /C:12 Choose Option.IF ERRORLEVEL 2 GOTO :END
IF ERRORLEVEL 1 GOTO :REMOTE
:REMOTE
net use q: \\[server]\XPusers
cls:INPUT
cls
echo.
set INPUT=
set /P INPUT=Type UserName: %=%
if "%INPUT%"=="" goto input
Cls
echo.
echo You Typed UserName: %INPUT%echo.
CHOICE /C:YNC Is This Correct?IF ERRORLEVEL 3 GOTO :END
IF ERRORLEVEL 2 GOTO :INPUT
IF ERRORLEVEL 1 GOTO :MD
:MD
cls
md o:\users\%INPUT%
echo The Folder Was Succesfuly Created.
echo.
Pause
goto :end:END
cls
echo.
Pause
ExitAnd after this the file is going on with a "robocopy" command... and i want to use the (for exampel) %input% to use in the rest of the bat file. But like you said the file is NOT working with input /p. But it works in xp. Can you help me with that. The file answer you sen me, did i not get to work...maby i do something wrong.
//Jonas

You're using 2 methods which aren't compatible with NT4. The "SET/P" to get user input, as I said before, and the usage of CHOICE.COM. That is an external application that is not present on NT systems by default. Though the file will work if the system has the application, it's unlikely to do so. You would probably need to include the application together with the batch file on eventual distribution of the script, which I consider bad, since there are easy ways around it. Nevertheless, if the script is for personal use only, it's OK using CHOICE.COM (but SET/P won't work whatsoever).
About the script I posted earlier, it ought to work. You see, if you run that script, it will simply wait for input with a final [ENTER], and will send that input to the %input% variable. It's up to you to add addaptions like a message telling user to enter input. Here's a sample:
@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=> %temp%.\input.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>> %temp%.\input.com
echo @]yI?@xAp~sA`LZNt@x[}?MGI@]A?nsl@]}G@tLC?sBZ`LBL`_jN0xxxxx>> %temp%.\input.com:INPUT
cls
echo.
echo Type UserName:
for /F "tokens=*" %%I in ('%temp%.\input.com') do set INPUT=%%I
if "%INPUT%"=="" goto input
cls
echo.
echo You Typed UserName: %INPUT%del %temp%.\input.com
Only delete the file %temp%.\input.com when you've already used as many times as you want (e.g.: on the end of the file) so you won't need to create it again.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br__________________________________________________________________________________________

Hi secret_doom.
It seems you may be able to help me.
I try to write the simplest of batch files using the choice-command:
choice /c:123 please choose optionwhen executed, the choice is not displayed and i get the message(roughly translated):
"command spelled incorrectly or not found. check spelling and variable 'PATH'."thanks for hints and tips.
Tobias.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |