Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: batch script dies after first call to another different batch script  (Read 8489 times)

0 Members and 1 Guest are viewing this topic.

quirkasaurus

    Topic Starter


    Greenhorn

    Thanked: 1
    • Experience: Beginner
    • OS: Unknown
    I have a script that basically calls another bunch of scripts in sequence. I don't care if any of them fail -- I want the script to continue.
    Unfortunately, it is not. Can anything be done? Here is the basic gist:

    CD C:\really\long\path\
    clam

    CD C:\another\really\long\path
    clam

    CD C:\yetanother\really\long\path
    clam

    After the first "clam", it just stops. "clam.bat" is a simple script that's stored in each directory with specific stuff to do.

    Thanks,

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: batch script dies after first call to another different batch script
    « Reply #1 on: March 09, 2011, 07:36:36 PM »
    use CALL clam
    I was trying to dereference Null Pointers before it was cool.

    quirkasaurus

      Topic Starter


      Greenhorn

      Thanked: 1
      • Experience: Beginner
      • OS: Unknown
      Re: batch script dies after first call to another different batch script
      « Reply #2 on: March 09, 2011, 09:33:33 PM »
      that was the first thing i tried to no avail.


      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: batch script dies after first call to another different batch script
      « Reply #3 on: March 09, 2011, 10:04:08 PM »
      do the clam.bat's call any other batch files?
      I was trying to dereference Null Pointers before it was cool.

      Sidewinder



        Guru

        Thanked: 139
      • Experience: Familiar
      • OS: Windows 10
      Re: batch script dies after first call to another different batch script
      « Reply #4 on: March 10, 2011, 06:30:32 AM »
      It would be helpful if you showed us the contents of 'clam', but in any case you need to use the 'call' statement if you expect a return to the caller (the batch file you posted).

      Code: [Select]
      CD /d "C:\really\long\path\"
      call clam

      CD /d "C:\another\really\long\path"
      call clam

      CD /d "C:\yetanother\really\long\path"
      call clam

      It might also be wise to turn echo on in 'clam' and any other batch files referenced. This will let you see how the file executes at all levels.

       8)
      The true sign of intelligence is not knowledge but imagination.

      -- Albert Einstein

      quirkasaurus

        Topic Starter


        Greenhorn

        Thanked: 1
        • Experience: Beginner
        • OS: Unknown
        Re: batch script dies after first call to another different batch script
        « Reply #5 on: March 10, 2011, 07:04:31 AM »
        ok. i'll try the "CALL" thing and "ECHO ON" and post the contents of clam.bat later today.
        Right now -- i'm at my other job for the next 8 hours.

        thanks for all the help everyone.

        quirkasaurus

          Topic Starter


          Greenhorn

          Thanked: 1
          • Experience: Beginner
          • OS: Unknown
          Re: batch script dies after first call to another different batch script
          « Reply #6 on: March 13, 2011, 07:32:24 AM »
          ok -- turns out it was a nestled script call without the "CALL". Modified. Reran. Worked.

          Thanks, all.

          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: batch script dies after first call to another different batch script
          « Reply #7 on: March 20, 2011, 11:59:46 AM »
          What is a "nestled script call?" Show the code and output.

          "show the code and output"? When did he become responsible to answer questions after his problem has been solved? Especially when you are questioning the very piece of information that explains his problem.

          nestled clearly means nested. I originally suspected one of the "nested" (batch files being called from the main batch) may have an additional batch call that wasn't using call, which is why I asked whether any of the said batches called additional batch files.

          Then he discovered the issue so there was no reason to further pursue it.
          I was trying to dereference Null Pointers before it was cool.