Computing.Net > Forums > Programming > batch file variable reset

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.

batch file variable reset

Reply to Message Icon

Name: fgsalama
Date: February 14, 2008 at 13:52:59 Pacific
OS: xp
CPU/Ram: .
Product: .
Comment:

I have the follwing patch file which calls two other batches:
e:
cd E:\SQLSERVER\SCRIPTS\INTELEX_LOADS
rem
get_date.bat studentdata.dat
rem
mail_bad.bat load_files\unmattched.txt
rem
and each of the sub batch files will work fine if called directly but when called using this batch only the first one will work and the 2nd one used the same variable on the previous line and ignor the vatriable in front of it completely. I get the same problem if I reverese the order of the sub batches!



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: February 14, 2008 at 14:26:21 Pacific
Reply:

If the sub batch files involved are

get_date.bat and mail_bad.bat

then from your post the second sub batch will never execute at all as to run sub batches in sequence inside a main script you have to code

......
call get_date studentdata.dat
......
......
call mail_bad load_files\unmattched.txt

otherwise after the first sub execution control is never released back.


0

Response Number 2
Name: fgsalama
Date: February 14, 2008 at 14:34:24 Pacific
Reply:

thanks for the quick response and I have tried that approch but still the 2nd batch never gets to see the varialbe listed!!


0

Response Number 3
Name: Mechanix2Go
Date: February 15, 2008 at 00:44:59 Pacific
Reply:

Is what you posted the EXACT code?

<font color


0

Response Number 4
Name: klint
Date: February 18, 2008 at 09:28:45 Pacific
Reply:

What do you mean by "the 2nd batch file never gets to see the variable listed"? Which variable?


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 Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file variable reset

Batch file variable creation www.computing.net/answers/programming/batch-file-variable-creation/14564.html

Batch file variables www.computing.net/answers/programming/batch-file-variables/16799.html

Batch File Variable Help www.computing.net/answers/programming/batch-file-variable-help/17718.html