Batch file in pause continue execution after firefox finish the work and will close












0















I have a batch file that checking the internet connection, if the connection internet is up, launch firefox with a macro and go on pause.



During this time fiefox works with the macro, after firefox finish the work automatically close.



Now i need to continue the code of the batch opened after firefox finished the works and will be closed but batch file reast in pause.



Exist a solution to continue the batch file opened without manual intervention ?



With firefox I can run another batch file or a software (using some javascript) but i need to continue the execution of batch file opened and I can not find any solution to continue the batch file.



This is the code of my batch file (ping to check connection, sound to alert me, start firefox with macro, pause batch file)



PING -n 5 www.wikipedia.org|FIND /I "TTL">NUL
IF NOT ERRORLEVEL 1 rundll32 user32.dll,MessageBeep 0x00000010L
IF NOT ERRORLEVEL 1 start "" "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim
IF NOT ERRORLEVEL 1 PAUSE


I do not know how long it takes for firefox to complete the job so I use the pause command.










share|improve this question



























    0















    I have a batch file that checking the internet connection, if the connection internet is up, launch firefox with a macro and go on pause.



    During this time fiefox works with the macro, after firefox finish the work automatically close.



    Now i need to continue the code of the batch opened after firefox finished the works and will be closed but batch file reast in pause.



    Exist a solution to continue the batch file opened without manual intervention ?



    With firefox I can run another batch file or a software (using some javascript) but i need to continue the execution of batch file opened and I can not find any solution to continue the batch file.



    This is the code of my batch file (ping to check connection, sound to alert me, start firefox with macro, pause batch file)



    PING -n 5 www.wikipedia.org|FIND /I "TTL">NUL
    IF NOT ERRORLEVEL 1 rundll32 user32.dll,MessageBeep 0x00000010L
    IF NOT ERRORLEVEL 1 start "" "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim
    IF NOT ERRORLEVEL 1 PAUSE


    I do not know how long it takes for firefox to complete the job so I use the pause command.










    share|improve this question

























      0












      0








      0








      I have a batch file that checking the internet connection, if the connection internet is up, launch firefox with a macro and go on pause.



      During this time fiefox works with the macro, after firefox finish the work automatically close.



      Now i need to continue the code of the batch opened after firefox finished the works and will be closed but batch file reast in pause.



      Exist a solution to continue the batch file opened without manual intervention ?



      With firefox I can run another batch file or a software (using some javascript) but i need to continue the execution of batch file opened and I can not find any solution to continue the batch file.



      This is the code of my batch file (ping to check connection, sound to alert me, start firefox with macro, pause batch file)



      PING -n 5 www.wikipedia.org|FIND /I "TTL">NUL
      IF NOT ERRORLEVEL 1 rundll32 user32.dll,MessageBeep 0x00000010L
      IF NOT ERRORLEVEL 1 start "" "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim
      IF NOT ERRORLEVEL 1 PAUSE


      I do not know how long it takes for firefox to complete the job so I use the pause command.










      share|improve this question














      I have a batch file that checking the internet connection, if the connection internet is up, launch firefox with a macro and go on pause.



      During this time fiefox works with the macro, after firefox finish the work automatically close.



      Now i need to continue the code of the batch opened after firefox finished the works and will be closed but batch file reast in pause.



      Exist a solution to continue the batch file opened without manual intervention ?



      With firefox I can run another batch file or a software (using some javascript) but i need to continue the execution of batch file opened and I can not find any solution to continue the batch file.



      This is the code of my batch file (ping to check connection, sound to alert me, start firefox with macro, pause batch file)



      PING -n 5 www.wikipedia.org|FIND /I "TTL">NUL
      IF NOT ERRORLEVEL 1 rundll32 user32.dll,MessageBeep 0x00000010L
      IF NOT ERRORLEVEL 1 start "" "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim
      IF NOT ERRORLEVEL 1 PAUSE


      I do not know how long it takes for firefox to complete the job so I use the pause command.







      windows command-line batch batch-file pause






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 28 at 23:19









      placidomaioplacidomaio

      165




      165






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can add the /WAIT parameter to the line that starts Firefox.



          IF NOT ERRORLEVEL 1 start "" /WAIT "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim


          That will then wait until Firefox exits before moving on to the next line of the batch file.



          Caution: not all executables will work this way. For example, if you use this approach to launch Microsoft Word (winword.exe), the batch file will continue without seeming to wait for Word to finish. This is because Winword.exe is a stub which launches the main Word application and then exits.



          See this description of the Start command for more details.






          share|improve this answer
























          • I will try yout solution soon and inform you about the results, thanks

            – placidomaio
            Jan 29 at 15:37











          • Tryed your solution and do not work tha batch file continue to execute commands ignoring /WAIT.

            – placidomaio
            Jan 30 at 23:40











          • It is possible that my test (FireFox.exe) respects the /Wait parameter, but your case (FireFoxPortable.exe) does not. Perhaps FireFoxPortable.exe is just a stub, much like winword.exe.

            – Doug Deden
            Jan 30 at 23:45











          • It's possibile the imacros://run/?m=work.iim is incompatible with /WAIT commands, after i lanched my batch file it continue to execute commands and firefox not have time to complete the work.

            – placidomaio
            Jan 30 at 23:47











          • So take out the imacros... part and see what happens. If Firefox starts, but the batch file waits until you close Firefox, then you know that the imacros parameter is at least partially to blame. But if the batch file continues processing, then something about the way FireFoxPortable.exe is launching is making the batch file think that Firefox has finished.

            – Doug Deden
            Jan 31 at 1:11











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1399448%2fbatch-file-in-pause-continue-execution-after-firefox-finish-the-work-and-will-cl%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You can add the /WAIT parameter to the line that starts Firefox.



          IF NOT ERRORLEVEL 1 start "" /WAIT "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim


          That will then wait until Firefox exits before moving on to the next line of the batch file.



          Caution: not all executables will work this way. For example, if you use this approach to launch Microsoft Word (winword.exe), the batch file will continue without seeming to wait for Word to finish. This is because Winword.exe is a stub which launches the main Word application and then exits.



          See this description of the Start command for more details.






          share|improve this answer
























          • I will try yout solution soon and inform you about the results, thanks

            – placidomaio
            Jan 29 at 15:37











          • Tryed your solution and do not work tha batch file continue to execute commands ignoring /WAIT.

            – placidomaio
            Jan 30 at 23:40











          • It is possible that my test (FireFox.exe) respects the /Wait parameter, but your case (FireFoxPortable.exe) does not. Perhaps FireFoxPortable.exe is just a stub, much like winword.exe.

            – Doug Deden
            Jan 30 at 23:45











          • It's possibile the imacros://run/?m=work.iim is incompatible with /WAIT commands, after i lanched my batch file it continue to execute commands and firefox not have time to complete the work.

            – placidomaio
            Jan 30 at 23:47











          • So take out the imacros... part and see what happens. If Firefox starts, but the batch file waits until you close Firefox, then you know that the imacros parameter is at least partially to blame. But if the batch file continues processing, then something about the way FireFoxPortable.exe is launching is making the batch file think that Firefox has finished.

            – Doug Deden
            Jan 31 at 1:11
















          0














          You can add the /WAIT parameter to the line that starts Firefox.



          IF NOT ERRORLEVEL 1 start "" /WAIT "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim


          That will then wait until Firefox exits before moving on to the next line of the batch file.



          Caution: not all executables will work this way. For example, if you use this approach to launch Microsoft Word (winword.exe), the batch file will continue without seeming to wait for Word to finish. This is because Winword.exe is a stub which launches the main Word application and then exits.



          See this description of the Start command for more details.






          share|improve this answer
























          • I will try yout solution soon and inform you about the results, thanks

            – placidomaio
            Jan 29 at 15:37











          • Tryed your solution and do not work tha batch file continue to execute commands ignoring /WAIT.

            – placidomaio
            Jan 30 at 23:40











          • It is possible that my test (FireFox.exe) respects the /Wait parameter, but your case (FireFoxPortable.exe) does not. Perhaps FireFoxPortable.exe is just a stub, much like winword.exe.

            – Doug Deden
            Jan 30 at 23:45











          • It's possibile the imacros://run/?m=work.iim is incompatible with /WAIT commands, after i lanched my batch file it continue to execute commands and firefox not have time to complete the work.

            – placidomaio
            Jan 30 at 23:47











          • So take out the imacros... part and see what happens. If Firefox starts, but the batch file waits until you close Firefox, then you know that the imacros parameter is at least partially to blame. But if the batch file continues processing, then something about the way FireFoxPortable.exe is launching is making the batch file think that Firefox has finished.

            – Doug Deden
            Jan 31 at 1:11














          0












          0








          0







          You can add the /WAIT parameter to the line that starts Firefox.



          IF NOT ERRORLEVEL 1 start "" /WAIT "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim


          That will then wait until Firefox exits before moving on to the next line of the batch file.



          Caution: not all executables will work this way. For example, if you use this approach to launch Microsoft Word (winword.exe), the batch file will continue without seeming to wait for Word to finish. This is because Winword.exe is a stub which launches the main Word application and then exits.



          See this description of the Start command for more details.






          share|improve this answer













          You can add the /WAIT parameter to the line that starts Firefox.



          IF NOT ERRORLEVEL 1 start "" /WAIT "D:Programmi InstallatiFirefoxFirefoxPortable.exe" imacros://run/?m=work.iim


          That will then wait until Firefox exits before moving on to the next line of the batch file.



          Caution: not all executables will work this way. For example, if you use this approach to launch Microsoft Word (winword.exe), the batch file will continue without seeming to wait for Word to finish. This is because Winword.exe is a stub which launches the main Word application and then exits.



          See this description of the Start command for more details.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 28 at 23:46









          Doug DedenDoug Deden

          870213




          870213













          • I will try yout solution soon and inform you about the results, thanks

            – placidomaio
            Jan 29 at 15:37











          • Tryed your solution and do not work tha batch file continue to execute commands ignoring /WAIT.

            – placidomaio
            Jan 30 at 23:40











          • It is possible that my test (FireFox.exe) respects the /Wait parameter, but your case (FireFoxPortable.exe) does not. Perhaps FireFoxPortable.exe is just a stub, much like winword.exe.

            – Doug Deden
            Jan 30 at 23:45











          • It's possibile the imacros://run/?m=work.iim is incompatible with /WAIT commands, after i lanched my batch file it continue to execute commands and firefox not have time to complete the work.

            – placidomaio
            Jan 30 at 23:47











          • So take out the imacros... part and see what happens. If Firefox starts, but the batch file waits until you close Firefox, then you know that the imacros parameter is at least partially to blame. But if the batch file continues processing, then something about the way FireFoxPortable.exe is launching is making the batch file think that Firefox has finished.

            – Doug Deden
            Jan 31 at 1:11



















          • I will try yout solution soon and inform you about the results, thanks

            – placidomaio
            Jan 29 at 15:37











          • Tryed your solution and do not work tha batch file continue to execute commands ignoring /WAIT.

            – placidomaio
            Jan 30 at 23:40











          • It is possible that my test (FireFox.exe) respects the /Wait parameter, but your case (FireFoxPortable.exe) does not. Perhaps FireFoxPortable.exe is just a stub, much like winword.exe.

            – Doug Deden
            Jan 30 at 23:45











          • It's possibile the imacros://run/?m=work.iim is incompatible with /WAIT commands, after i lanched my batch file it continue to execute commands and firefox not have time to complete the work.

            – placidomaio
            Jan 30 at 23:47











          • So take out the imacros... part and see what happens. If Firefox starts, but the batch file waits until you close Firefox, then you know that the imacros parameter is at least partially to blame. But if the batch file continues processing, then something about the way FireFoxPortable.exe is launching is making the batch file think that Firefox has finished.

            – Doug Deden
            Jan 31 at 1:11

















          I will try yout solution soon and inform you about the results, thanks

          – placidomaio
          Jan 29 at 15:37





          I will try yout solution soon and inform you about the results, thanks

          – placidomaio
          Jan 29 at 15:37













          Tryed your solution and do not work tha batch file continue to execute commands ignoring /WAIT.

          – placidomaio
          Jan 30 at 23:40





          Tryed your solution and do not work tha batch file continue to execute commands ignoring /WAIT.

          – placidomaio
          Jan 30 at 23:40













          It is possible that my test (FireFox.exe) respects the /Wait parameter, but your case (FireFoxPortable.exe) does not. Perhaps FireFoxPortable.exe is just a stub, much like winword.exe.

          – Doug Deden
          Jan 30 at 23:45





          It is possible that my test (FireFox.exe) respects the /Wait parameter, but your case (FireFoxPortable.exe) does not. Perhaps FireFoxPortable.exe is just a stub, much like winword.exe.

          – Doug Deden
          Jan 30 at 23:45













          It's possibile the imacros://run/?m=work.iim is incompatible with /WAIT commands, after i lanched my batch file it continue to execute commands and firefox not have time to complete the work.

          – placidomaio
          Jan 30 at 23:47





          It's possibile the imacros://run/?m=work.iim is incompatible with /WAIT commands, after i lanched my batch file it continue to execute commands and firefox not have time to complete the work.

          – placidomaio
          Jan 30 at 23:47













          So take out the imacros... part and see what happens. If Firefox starts, but the batch file waits until you close Firefox, then you know that the imacros parameter is at least partially to blame. But if the batch file continues processing, then something about the way FireFoxPortable.exe is launching is making the batch file think that Firefox has finished.

          – Doug Deden
          Jan 31 at 1:11





          So take out the imacros... part and see what happens. If Firefox starts, but the batch file waits until you close Firefox, then you know that the imacros parameter is at least partially to blame. But if the batch file continues processing, then something about the way FireFoxPortable.exe is launching is making the batch file think that Firefox has finished.

          – Doug Deden
          Jan 31 at 1:11


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1399448%2fbatch-file-in-pause-continue-execution-after-firefox-finish-the-work-and-will-cl%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Plaza Victoria

          Puebla de Zaragoza

          Musa