Varibale not holding its value

September 27, 2012 at 05:11:54
Specs: Windows Server 2007
I am loosing the value stored in a variable, but I call a another batch script in my batch script. Does anyone have any clue why this is happening?

In the below code, after calling payer-multiFile-HDI_SSI_LA60_MIX.bat the variables DEST_UNZIP_DIR and UPLOADH_DIR losses their values

echo MultifileDelivery - Moving zipped file %%K to !DEST_DIR! >> %LOG_FNAME%
move "!DIRPATH!%%K" "!DEST_DIR!"
echo Extracting file to ......%%K....!DEST_UNZIP_DIR! >> %LOG_FNAME%
E:\Axway\Synchrony\Transfer_CFT\CFTFRWK\utilities\zip\windows\unzip -o "!DEST_DIR!%%K" -d "!DEST_UNZIP_DIR!" >> %LOG_FNAME% 2>&1
echo destunzip dir is---- !DEST_UNZIP_DIR! >> %LOG_FNAME%
echo destuploadhdir is------ !UPLOADH_DIR! >> %LOG_FNAME%
REM Below multifile delivery called by Dalbir
E:\Axway\Synchrony\Transfer_CFT\CFTFRWK\utilities\payer-multiFile-HDI_SSI_LA60_MIX.bat %IDF%
echo Waiting 120 secs to trigger subsequent interface scripts.......%%K >> %LOG_FNAME%
echo %%K -Triggering interface script - >> %LOG_FNAME%
echo destunzip dir is:: !DEST_UNZIP_DIR! >> %LOG_FNAME%
echo destuploadhdir is:: !UPLOADH_DIR! >> %LOG_FNAME%

See More: Varibale not holding its value

Report •

September 27, 2012 at 06:31:34
Unable to replicate using Win7 x86:
Thu 2012.09.27  9.28.49
M:\>type a.cmd
@set abc=123

Thu 2012.09.27  9.29.14
M:\>type b.cmd
@echo %%abc%% is %abc%

Thu 2012.09.27  9.29.15
%abc% is 123

How To Ask Questions The Smart Way

Report •

September 27, 2012 at 17:29:14
How is your main batch even continuing, beyond:
E:\Axway\Synchrony\Transfer_CFT\CFTFRWK\utilities\payer-multiFile-HDI_SSI_LA60_MIX.bat %IDF%

since you didn't use "call" to invoke the E:\long\longer\too-long-name batch?

Report •

September 27, 2012 at 21:09:16
the batch script E:\Axway\Synchrony\Transfer_CFT\CFTFRWK\utilities\payer-multiFile-HDI_SSI_LA60_MIX.bat is running as expected and the wrapper script is also continuing beyond this, but the variables are loosing their values.
Could you please let me know why to use "CALL" <script name> even when the script payer-multiFile-HDI_SSI_LA60_MIX.bat is executing without "call".

Report •

Related Solutions

Ask Question