Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Batch script to launch batch xml files from folder

Jun 21, 2013 2:00AM PDT

I have a req where we have set of batch xml files in C:\Today\set folder and I need to execute these xml files one by one automatically using batch script and if these files execute successfuly goes to success.log file if they are failed then will go to error.log file and scheduleBatch.cmd is inbuit utility file which executes these xml files.Please help me out how to design the code with this req.I really appreciate your help and Thanks in advance

@ECHO OFF
set userid=joe
set pwd=jackson
SET "xml_dir=c:\today\set"
SET "hyp_server=10.11.12.13"
For %%z in ("%xml_dir%\*.xml") do (
call schedulebatch "%%z" %userid% %pwd% %hyp_server%
if errorlevel 1 >>"C:\Today\xml-error.log" echo "%%z" failed
if not erorlevel 0 >>"C:\Today\xml-pass.log" echo "%%z" succeeded
)

Discussion is locked