By monisha
@echo off
SET "p0=%~0"
SET "p1=%~1"
SET "p2=%~2"
SET "p3=%~3"
SET "p4=%~4"
SET "p5=%~5"
SET "p6=%~6"
SET "p7=%~7"
SET "p8=%~8"
SET "p9=%~9"
SHIFT
SET "p10=%~9"
SHIFT
SET "p11=%~9"
SET "zip_path=D:OraOutputinterco%p10%"
echo Program Name : %p0%
rem echo "Next param : %p1%
echo Next param : Username/Password
echo User Id : %p2%
echo User Name : %p3%
echo Request ID : %p4%
echo File Name : %p5%
echo Entity Name : %p6%
echo Email Address : %p7%
echo Extract ID : %p8%
echo path name : %p9%
echo share directory : %p10%
echo Master Request ID : %p11%
rm !(D:tempXX.txt)
echo Process and Mail Output files
echo %zip_path%
IF NOT EXIST D:OraOutputinterco%p10%out%p11% GOTO MAPERROR
cd D:OraOutputinterco%p10%out%p11%
echo changed to D:OraOutputinterco%p10%out%p11%
IF EXIST D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip rm D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
zip -j D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip D:OraOutputinterco%p10%out%p11%*.*
echo after zip
IF NOT EXIST D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip GOTO ENDPROCESS
echo zip file exists after zip
REM rm D:OraOutputinterco%p10%chello_interco*.*
echo Before Mail to %p7%
D:OraOutputintercoes.exe %p7% "Chello Interco Extract has completed" "Please find attached the compressed Intercompany spreadsheets" D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
echo After Mail to %p7%
rm D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
GOTO ENDPROCESS
:MAPERROR<br ...read more
Source: FULL ARTICLE at The UNIX and Linux Forums