Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch Programming in Windows 2000

Status
Not open for further replies.

Segfault666

IS-IT--Management
Apr 19, 2002
27
CA
I don't know exactly where to go; so I'm simply posting this here.

I would like to recieve input from con and place the value into the %USER_1% variable

Something like "copy con %USER_1%" but not. That sends it to wherever user_1 points. I want basically "set CON=%USER_1%"; CON being input from the console. If anyone can give me a hand it would be greatly appreciated.

thx
-- ian
 
Forgive me if this seems a bit messy. I might be doing this the hard way (I have a habit of this)

If I understand correctly, you want to do a copy con, have the user input something, hit CTRL+Z and Enter, and then have the user's input turned into a variable.

Here is how I do it.

copy con c:\test\test.txt
For /F %%I in (c:\test\test.txt) do echo set test=%%I > tempbat.bat
call tempbat.bat
del tempbat.bat
echo %test%


That does work with 2k, BTW. For future reference, I don't know if many batch file questions get answered here, but I do know that people post them in 2k pro and win nt forums. Merry Christmas [santa]
Mudskipper
___________________________________________________________________________________

Groucho said it best- "A four year-old child could understand this! Quick! Run out and find me a four year-old child: I can't make heads nor tails out of this!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top