Help with passing variable
Posted: 13 Nov 2006 18:28
Hello all my first post here, Im having a little trouble with a script im working on. Specifically, i need to know how to pass the info in a text file to a variable i create, I am somewhat new to batch scripting and i have tried everything but i just cant seem to figure it out.
This script will only be used in the windows XP console.
For an example, in it's simplest form this is what im after, i can probably take it to more complicated levels once i know how to do it:
:: output something from the console then send to txt file
DIR | Find "bytes free" > bytes.txt
:: asign the string inside the text file to a variable
SET BYTES = "the string inside bytes.txt"
::display the value of the string
echo %BYTES%
do you even need the intermediate text file? is this even possible?
This script will only be used in the windows XP console.
For an example, in it's simplest form this is what im after, i can probably take it to more complicated levels once i know how to do it:
:: output something from the console then send to txt file
DIR | Find "bytes free" > bytes.txt
:: asign the string inside the text file to a variable
SET BYTES = "the string inside bytes.txt"
::display the value of the string
echo %BYTES%
do you even need the intermediate text file? is this even possible?