Output pass parameter to a text file

May 12, 2011 at 09:58:01
Specs: Windows Vista
I have a batch file called test.bat. I call it from DOS like this: c:\test.bat R2eMAR04, passing the parameter R2eMAR04. How do I output the pass parameter to a text file called log.txt.
I tried this; but, I get an error.
@echo off
cls
Set var = %1%
%1% > log.txt

Thanks for your help...!


See More: Output pass parameter to a text file

Report •


#1
May 12, 2011 at 12:11:27
Try:
set var=%1
echo %var%>log.txt

or
echo %1>log.txt


Please come back & tell us if your problem is resolved.


Report •

#2
June 23, 2011 at 09:39:19
Thanks Wahine.
Right after I posted I found the answer.
You are right.

echo %1 > log.txt works
Thansk.!


Report •

Related Solutions


Ask Question