Reading variables from a text file Using For /F command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
rfpd
Posts: 78
Joined: 06 Jul 2009 16:19
Location: Lisbon, Portugal
Contact:

Re: Reading variables from a text file Using For /F command

#16 Post by rfpd » 22 Dec 2010 17:12

Write

Code: Select all

echo :your text or variable; > your file

Read

Code: Select all

for /f "tokens=2 delims=:;" %%a in (your file) do (
set your variable name=%%a
)


and then echo %your variable name% to show it

It's important that the code has the : and ; or it will not work

Post Reply