Discussion:
MS-DOS 6.22 Batch File User Input to Environment Variable
(too old to reply)
Brian
2008-06-04 18:58:53 UTC
Permalink
I need to take in user input (at the moment I am using copy con) with
a batch file and place it in an environment variable so other batch
files can access the user input. I can only use the standard commands
that come with MS-DOS 6.22. Does anyone have any ideas?
Timo Salmi
2008-06-04 19:37:54 UTC
Permalink
Post by Brian
I need to take in user input (at the moment I am using copy con) with
a batch file and place it in an environment variable so other batch
files can access the user input. I can only use the standard commands
that come with MS-DOS 6.22. Does anyone have any ideas?
FAQ
254761 Nov 11 2005 ftp://garbo.uwasa.fi/pc/link/tsbat.zip
tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi,

All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:***@uwasa.fi <http://www.uwasa.fi/~ts/> ; FI-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html
foxidrive
2008-06-05 07:33:39 UTC
Permalink
Post by Brian
I need to take in user input (at the moment I am using copy con) with
a batch file and place it in an environment variable so other batch
files can access the user input. I can only use the standard commands
that come with MS-DOS 6.22. Does anyone have any ideas?
@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
Brian
2008-06-05 13:58:42 UTC
Permalink
Post by Brian
I need to take in user input (at the moment I am using copy con) with
a batch file and place it in an environment variable so other batch
files can access the user input.  I can only use the standard commands
that come with MS-DOS 6.22.  Does anyone have any ideas?
For some reason the machine I have to work with does not have fc.exe.
Does anyone know where I can get one that will work on MS-DOS 6.22.
Herbert Kleebauer
2008-06-05 15:06:17 UTC
Permalink
Post by Brian
Post by Brian
I need to take in user input (at the moment I am using copy con) with
a batch file and place it in an environment variable so other batch
files can access the user input. I can only use the standard commands
that come with MS-DOS 6.22. Does anyone have any ideas?
For some reason the machine I have to work with does not have fc.exe.
Does anyone know where I can get one that will work on MS-DOS 6.22.
@echo off
echo BATCH_INPUT___hgQX-PPP_XPPP E#HH0E50EG0Ef0Ehs>myinput.com
echo myinput.bat hoAX5@@***@xX5@D3!r/P[WX,b,-PZh>>myinput.com
echo X3!X2ErP,{,{PYX4=0ErWX,j,-PZh@@X3!=set input>>myinput.com

echo Enter your name:
myinput.com
call myinput.bat
echo.
echo Hello %input%
echo.
Brian
2008-06-05 16:25:53 UTC
Permalink
Post by Brian
Post by Brian
I need to take in user input (at the moment I am using copy con) with
a batch file and place it in an environment variable so other batch
files can access the user input.  I can only use the standard commands
that come with MS-DOS 6.22.  Does anyone have any ideas?
For some reason the machine I have to work with does not have fc.exe.
Does anyone know where I can get one that will work on MS-DOS 6.22.
I found another work that has worked for me. Thank you for your help

@This is the main batch file
@echo off
echo enter input followed by ctrl-z:
copy con usrinp.tmp
echo. >> usrinp.tmp
echo. >> usrinp.tmp
type usrinp.tmp | date | find "):" > usrinp.bat
call usrinp.bat
---------------------------------------------------
@support bat file named enter.bat
@echo off
if %2==date set usrinp=%4
-------------------------------------------------------

You can do some cleanup commands after calling usrinp.bat
The new environment variable will be usrinp

Loading...