Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passing User input to an output file.

20 views
Skip to first unread message

Ja...@jjst.com

unread,
Jun 19, 2006, 3:10:49 PM6/19/06
to
Hi,

Please can someone assist me with the following.

Set /P Works very well in a Winnt environment and dose what I need.

What I am trying to do is have a DOS batch file prompt the user for a
User response IE. Computer name and then be able to use this value to
update an unnatend.ttxt file that already exists.

Any help will be much appreciated.


Jack...

foxidrive

unread,
Jun 19, 2006, 3:22:31 PM6/19/06
to

Here are two methods I have saved from past discussions. I think they will
both work in MSdos/Win9x/ME but I haven't tried them recently so don't
recall:

:: Herbert Kleebauer - universal batch input
@echo off
echo BATCH_INPUT___hhQX-PPP^XPPP D"HH0D40DF0De0Dgs>myinput.com
echo myinput.bat hoAX5@@PZYh@xX5@D3!r/P[VX,b,.PZh>>myinput.com
echo X3!X2DqP,{,{PYX4=0DqVX,j,.PZh@@X3!=set input>>myinput.com
echo Enter name:
myinput.com
call myinput.bat
del myinput.com
del myinput.bat
echo You entered %input%

@echo off
:INPUT.BAT puts what is typed next in environment variable INPUT
set input=
echo INPUT.BAT
echo Type in something and press [Enter]
fc con nul /lb1 /n|date|find " 1: ">temptemp.bat
echo :Loop>>enter.bat
echo if not (%%input%%)==() set input=%%input%% %%5>>enter.bat
echo if (%%input%%)==() set input=%%5>>enter.bat
echo shift>>enter.bat
echo if not (%%5)==() goto Loop>>enter.bat
for %%x in (call del) do %%x temptemp.bat
del enter.bat
echo The string you just entered:
echo %input%
echo has been stored in an environment variable named INPUT
:End

0 new messages