How do i Save/Load Batch Variables From a text file or any other file?
is this possible?
and if so how do i do this??
If your file looks like: x=abc
z=qwerty:: ===== script starts here ===============
::
:: vfromt.bat 2012-07-23 14:45:04.17
@echo off > newfile & setLocal enableDELAYedeXpansioNfor /f "tokens=* delims= " %%a in (my.txt) do (
set %%a
)
set
goto :eof::====== script ends here =================
====================================
Life is too important to be taken seriously.M2
Can you explain how this works clearly please?, i still dont understand.
also, is it possible to load commands from a text file?
the contents of my.txt x=abc
z=qwertyusing the script above "vfromt.bat" (from Mechanix2Go)
It loops through my.txt and pulls the lines in to be stored in %%a
then each time it pulls said line it uses the set %%a to assign a variableso for example the
::first time through it changes
set %%a to set x=abc
::then the second loop
set %%a to set z=qwertyYou could technically do this with any command I suppose.
:: mike
cool thanks