
March 9th, 2008, 11:51 AM
|
|
Registered User
|
|
Join Date: Mar 2008
Posts: 1
Time spent in forums: 13 m 52 sec
Reputation Power: 0
|
|
General - Issues with batch programming and pipes
Although I've mainly used high-level languages in the past, I felt the urge to do something very basic - writing Windows Batch files. And indeed, that proves quite useful. But right now there's something I don't get. Using the | character, you use a pipe to send the output of one program to the input of another. Very un-Windows-like, at least. This works perfectly:
Code:
echo 03-09-08 | date
the date command expects a new date in this format, and that's what i supply.
Somehow, this doesn't work:
Code:
cd | set /p folder=
"set /p VARNAME=" prompts for a value to assign to VARNAME, and I'd like to set the current directory. It refuses to work.
For some strange reason, this works:
Code:
cd > tmp
set /p folder= < tmp
I hope someone is experienced with this, and can help me out!
|