Page 1 of 1
Need help using the Call command
Posted: 27 Sep 2010 10:09
by kmarty009
I have a series scripts that I want called from (1) script. I need to see these jobs in the scheduled tasks and I created this script to call all of them. However, it is only calling (1) script. Do I need to do something else to call multiple scripts? Please help me figure this out. The second call command never works. It is only running the script on the first call command.
@ECHO OFF
REM replicate to 4_From_SV to to 5_Add_Monogram - Completed With Crest
call repl_eagan_4_to_5_cwc.cmd
REM replicate to 4_From_SV to to 5_Add_Monogram - Completed Without Crest
call repl_eagan_4_to_5_cwoc.cmd
Re: Need help using the Call command
Posted: 27 Sep 2010 10:59
by sweener
This SHOULD work, but I have run into some things like this before. It could be as simple as an "exit" command or something. Does this first repl_eagan_4_to_5_cwc.cmd script have an "exit" command in it? If not, what happens when you run this script by itself? I put a "pause" command at the end of a script to see if anything is up. If you do not have a command window open saying "Press any key to continue . . .", then it is possible you've got something wrong in your script.
From there, if I do not get the "Press any key" deal, I open a command prompt, call the script and see what it says. Sometimes when I make silly mistakes it will say "someCharacter was unexpected at this time".
I really can't help you directly unless you shared your code in the repl_eagan_4_to_5_cwc.cmd. I have other suggestions, but I would try an see if any of these were helpful first. You may also want to redirect output from repl_eagan_4_to_5_cwc.cmd into a log.txt file:
Code: Select all
CALL repl_eagan_4_to_5_cwc.cmd > c:\log.txt
Let me know if you still have problems
Re: Need help using the Call command
Posted: 27 Sep 2010 12:17
by !k
kmarty009
Probably, scheduler can't find .CMDs
Try to use the full paths to .CMD's
Re: Need help using the Call command
Posted: 28 Sep 2010 06:25
by orange_batch
!k wrote:kmarty009
Probably, scheduler can't find .CMDs
Try to use the full paths to .CMD's
Just to be clear, that would be for example:
call "C:\...\My Folder\my script.cmd"