Solved how to read and set variable from file.txt

May 25, 2012 at 14:19:15
Specs: Windows XP
I have file.txt which contains the name of file.txt as follows.

And I need to set the name of file.txt in each line to variable in order to print out with nodepad.exe command.

NOTEPAD.EXE /PT "%filename%" "%printername%"

Could anyone kindly suggest me to solve this problem?

See More: how to read and set variable from file.txt

Report •

June 8, 2012 at 12:22:28
✔ Best Answer
for /f "tokens=4 delims=\" %%G in (file.txt) DO NOTEPAD.EXE /PT "%%G" "%printername%"
::you will need to set the printername variable i assume

:: mike

Report •
Related Solutions

Ask Question