Computing.Net > Forums > Disk Operating System > passing variable between batch 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.

passing variable between batch file

Reply to Message Icon

Name: thenewguy
Date: September 15, 2003 at 15:15:56 Pacific
OS: win98
CPU/Ram: P4 256DDR
Comment:

If i want to pass a variable declared:

set response=Assignment

how do i pass this variable to another batch file when using the call function?



Sponsored Link
Ads by Google

Response Number 1
Name: Nathan
Date: September 15, 2003 at 17:01:32 Pacific
Reply:

it automaticly does. what do you mean. I set up an example

-----------------one.bat----------------
@echo off
set response=Assignment
call two.bat
------------

------------------two.bat----------------
@echo off
echo response=%response%
pause>nul
------------

since its still in the same window it keeps all the variables the same.


0

Response Number 2
Name: thenewguy
Date: September 15, 2003 at 17:34:25 Pacific
Reply:

oh, well im going to try that but someone else told me to use this for now anyways:

CALL c:\windows\desktop\top\vers %1 %response%

it does work, but is either one preferable to the other?


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 Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: passing variable between batch file

Variables in batch files www.computing.net/answers/dos/variables-in-batch-files/12289.html

Passing Variable to Batch www.computing.net/answers/dos/passing-variable-to-batch/9649.html

Batch file command needed www.computing.net/answers/dos/batch-file-command-needed/2641.html