Click here to Skip to main content
15,947,411 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am trying to include a delay of 120 secs between following two DOS commands in .bat script:

COPY \\CDFS23001\\SOURCE\ORG\*ACCOUNTS*.xml \\CDFS23001\\SOURCE\TGT\

TIMEOUT /T 120 /NOBREAK

dir /b \\CDFS23001\\SOURCE\TGT\*ACCOUNTS*.xml > \\CDFS23001\\SOURCE\TGT\List_Accounts.txt

The above timeout is working perfectly when directly executing the .bat script directly or through command prompt but doesn't works when running through a task in other tool (command task in ETL tool - Informatica Powercenter).

The COPY and DIR commands are working fine but only the TIMEOUT doesnt work when batch file called through an external task.

I have also tried PING, CHOICE, PAUSE, SLEEP none of them works here when .bat file called though external task.

Can anyone please suggest me what might be the issue or any other way to include a time delay between above two commands.

Thanks in advane

What I have tried:

I have also tried PING, CHOICE, PAUSE, SLEEP none of them works here.
Posted
Updated 5-Jul-18 9:38am
v3
Comments
Alan N 4-Jul-18 6:22am    
Before any one can attempt to answer they will need to know what you mean by "when running through a task in other tool"
Aditya_ETL 4-Jul-18 6:25am    
Thanks Alan, I have updated the question and included the tool details
Richard MacCutchan 4-Jul-18 7:40am    
You need to gather more information to find out exactly what happens when you run it through the tool. Add some echo statements and capture all the output.
Sajjid Atta 4-Jul-18 16:33pm    
I've Never worked on your tool but try this command. That may work
waitfor SomethingThatIsNeverHappening /t 100
Aditya_ETL 5-Jul-18 5:18am    
Wonderful..!!!! It worked, Thanks a ton

Regards,
Aditya

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900