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.
getting a variable from batch file
Name: revanth84 Date: August 1, 2008 at 04:45:54 Pacific OS: Windows XP CPU/Ram: 1GB Product: Professional
Comment:
How to get a return variable from the called batch-file ?
I'm having two batch files as follows
A.bat : for /f "tokens=* delims=" %%a in (files.txt) do ( call B.bat var1 var2 var3 )
B.bat: set var4=%1 + %2 - %3 REM some process like this set var5=
I want to use var4 and var5 in A.bat Is there a go? I found the following URL relevant for this topic, but still no way out http://www.marijn.org/archive/2006/...
Of all the things I've lost, I miss my Mind the most
Name: Razor2.3 Date: August 1, 2008 at 06:47:45 Pacific
Reply:
Command scripts are procedural and without boundaries for variables. You may use var4 and var5 in the first script after they're set in the second. (Assuming the second script doesn't use SETLOCAL, of course.)
EDIT: Never stopped me before. VVVVVVVVVVVVVVVVVVVVVVVVVV
0
Response Number 3
Name: klint Date: August 1, 2008 at 06:55:22 Pacific
Reply:
[Message deleted. Sorry. Razor got there first with the same information.]
Summary: Hi A task which will run based on values provided to a parameter in textfile. i.e param1 = 123 Now i am paasing this value dynamically using a variable to that tast i.e param1 = B1 at this stage i am ...
Summary: I have a batch file which displays a list of databases and allows the user to choose the one that they wish to start by typing in the name of the database (I use a "set /p" command to get the user inp...