Need help using the Call command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
kmarty009
Posts: 1
Joined: 27 Sep 2010 10:03

Need help using the Call command

#1 Post by kmarty009 » 27 Sep 2010 10:09

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

sweener
Posts: 18
Joined: 06 Jan 2010 13:00
Location: Indianapolis, IN

Re: Need help using the Call command

#2 Post by sweener » 27 Sep 2010 10:59

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

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: Need help using the Call command

#3 Post by !k » 27 Sep 2010 12:17

kmarty009
Probably, scheduler can't find .CMDs
Try to use the full paths to .CMD's

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: Need help using the Call command

#4 Post by orange_batch » 28 Sep 2010 06:25

!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"

Post Reply