Sunday 15 January 2012

Using a batch file to pass a variable containing a the name to be used when creating the output text file -



Using a batch file to pass a variable containing a the name to be used when creating the output text file -

i have simple batch file reads txt file , checks number "1", , creates batch file results - simple works expected.

@echo off

find /i " 1" "c:\passfail.txt" > c:\passfailresult.txt

i want name output txt file using variable:

e.g. find /i " 1" "c:\passfail.txt" > c:\"variablename".txt

can tell me how can this?

the variable name study id stored in location need load variable name batch file , utilize variable name of output report.

i running script on windows server 2008 sp1, i'm new batch processing.

thanks

for /f %%a in ("the other file") set outputfile=%%a find "1" "c:\passfail.txt" > "c:\%outputfile%.txt"

batch-file

No comments:

Post a Comment