Computing.Net > Forums > Programming > Variable from a file?

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.

Variable from a file?

Reply to Message Icon

Name: Mathieu Gendreau
Date: July 31, 2005 at 18:46:22 Pacific
OS: Windows 98SE
CPU/Ram: not needed
Comment:

Hello everybody,
Let me explain my question, I have 2 batch file, the first one create a file with a value in it and the second need to set a variable using the value given in the file.

set variable=<myvariable.txt didn't work.

Sincerly yours,
Mathieu Gendreau



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: August 1, 2005 at 03:53:02 Pacific
Reply:

Hi,

"set variable=<myvariable.txt didn't work"

You're right; that won't work.

Neither will this:
set /p variable=<myvariable.txt

Try this:

::== my.bat
@echo off
echo set myvar=mystring > setMYvar.bat
setMYvar
::==

M2


If at first you don't succeed, you're about average.


0

Response Number 2
Name: Mathieu Gendreau
Date: August 1, 2005 at 16:48:30 Pacific
Reply:

Hello mechanix2go,
Thank you for this script, it worked like a charm.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Cafe assistant Incrementing variables



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: Variable from a file?

Variable from a list file www.computing.net/answers/programming/variable-from-a-list-file/17057.html

Taking variables from a file www.computing.net/answers/programming/taking-variables-from-a-file/9954.html

Win32: Reading a texts from a file www.computing.net/answers/programming/win32-reading-a-texts-from-a-file/11673.html