Computing.Net > Forums > Programming > Storing into variables

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Storing into variables

Reply to Message Icon

Name: Spoonman184
Date: November 4, 2007 at 22:57:03 Pacific
OS: Windows XP SP2
CPU/Ram: AMD Duron 512MB
Product: Not Sure
Comment:

Is it possible to grab text from a text file and store it into a variable within a currently running batch file?



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: November 5, 2007 at 03:16:27 Pacific
Reply:

Yes, something like this:

for /f "options..." %%a in (file.txt) do (
commands...
)

For more information type for /?

Good luck...
klint


0

Response Number 2
Name: tonysathre
Date: November 5, 2007 at 10:33:17 Pacific
Reply:

More like this:

for /f "tokens=*" %%i in (vars.txt) do (
set myvar=%%i
)

"Computer security." — Oxymoron


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Storing into variables

Filename as stored variable www.computing.net/answers/programming/filename-as-stored-variable/20128.html

for loop find result into variable www.computing.net/answers/programming/for-loop-find-result-into-variable/20281.html

Resolve MX-record from DNS into var www.computing.net/answers/programming/resolve-mxrecord-from-dns-into-var/9964.html