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

Author Topic: another script runed by batch goes into loop  (Read 2968 times)

0 Members and 1 Guest are viewing this topic.

Blisk

    Topic Starter


    Intermediate

    Thanked: 1
    • Experience: Familiar
    • OS: Windows 7
    another script runed by batch goes into loop
    « on: February 22, 2019, 02:22:42 AM »
    I have problem when first batch start second batch than that second batch is runned fev times with 1 second appart.
    Have anyone idea what can cause that and how to prevent that, so second script is run only once?

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: another script runed by batch goes into loop
    « Reply #1 on: February 22, 2019, 09:30:09 AM »
    Can you share what your batch instructions look like so we can see what your doing to help you correct the problem.

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: another script runed by batch goes into loop
    « Reply #2 on: February 22, 2019, 09:36:35 AM »
    You're Help requests lack details most of the time....
    You have been here long enuff to know the drill by now...

    Just sayin.
    " Anyone who goes to a psychiatrist should have his head examined. "

    Blisk

      Topic Starter


      Intermediate

      Thanked: 1
      • Experience: Familiar
      • OS: Windows 7
      Re: another script runed by batch goes into loop
      « Reply #3 on: February 22, 2019, 10:08:46 AM »
      I have this script in one of batch which search and call copy_sendmail.bat
      Everytime it runs I get log file run_bats_alarm.txt
      When I check run_bats_alarm.txt I see it was runned 6 times for 1 second appart

      Code: [Select]
      echo start run bats %date% %time% >> run_bats_alarm.txt

      set startdir=%cd%
      for /d %%i in (*) do (
      cd %%i
      if exist "copy_sendmail.bat" call "copy_sendmail.bat"
      cd %startdir%
      )


      In next bat file I have this at the bottom of batch

      Code: [Select]
      start cmd /c "\\cpisrv1\skleda\programi\progscr\logiranje\log.bat"

      in file log.bat I have also this for logs
      Code: [Select]
      echo start run log %date% %time% >> log.txt
      and when I check I check log.txt I see it is runned every fev seconds or minutes, like this hour_minutes_seconds
      18_20_22
      18_20_31
      18_20_56
      18_22_02 
      18_24_30
      18_35_21