WinRAR - Using rar.exe command line to extract all files in all archives in a folder then delete all the...












0















I want to use rar.exe via command line to extract all files in all archives in a folder then delete all the archives automatically if they extracted successfully? I tried -df and -dr to no avail. Seems like those may only for deleting the files if you're adding them to an archive.



Right now I'm using (c#):



string.Format("e -p{0} "{1}" *.* "{2}"", pass, fi[n].FullName, fi[n].DirectoryName)









share|improve this question

























  • Rather than what you're doing in C#, please always show the actual commands that are called.

    – slhck
    Jul 20 '14 at 11:04
















0















I want to use rar.exe via command line to extract all files in all archives in a folder then delete all the archives automatically if they extracted successfully? I tried -df and -dr to no avail. Seems like those may only for deleting the files if you're adding them to an archive.



Right now I'm using (c#):



string.Format("e -p{0} "{1}" *.* "{2}"", pass, fi[n].FullName, fi[n].DirectoryName)









share|improve this question

























  • Rather than what you're doing in C#, please always show the actual commands that are called.

    – slhck
    Jul 20 '14 at 11:04














0












0








0








I want to use rar.exe via command line to extract all files in all archives in a folder then delete all the archives automatically if they extracted successfully? I tried -df and -dr to no avail. Seems like those may only for deleting the files if you're adding them to an archive.



Right now I'm using (c#):



string.Format("e -p{0} "{1}" *.* "{2}"", pass, fi[n].FullName, fi[n].DirectoryName)









share|improve this question
















I want to use rar.exe via command line to extract all files in all archives in a folder then delete all the archives automatically if they extracted successfully? I tried -df and -dr to no avail. Seems like those may only for deleting the files if you're adding them to an archive.



Right now I'm using (c#):



string.Format("e -p{0} "{1}" *.* "{2}"", pass, fi[n].FullName, fi[n].DirectoryName)






command-line c# rar winrar command-line-arguments






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 20 '14 at 8:40









Jens Erat

12.8k114660




12.8k114660










asked Jul 20 '14 at 7:52









Mike GMike G

111




111













  • Rather than what you're doing in C#, please always show the actual commands that are called.

    – slhck
    Jul 20 '14 at 11:04



















  • Rather than what you're doing in C#, please always show the actual commands that are called.

    – slhck
    Jul 20 '14 at 11:04

















Rather than what you're doing in C#, please always show the actual commands that are called.

– slhck
Jul 20 '14 at 11:04





Rather than what you're doing in C#, please always show the actual commands that are called.

– slhck
Jul 20 '14 at 11:04










2 Answers
2






active

oldest

votes


















0















Seems like those may only for deleting the files if you're adding them to an archive.




Seems to be the case, yes,




$ unrar --help | grep -i unrar
UNRAR 5.00 beta 8 freeware Copyright (c) 1993-2013 Alexander Roshal
Usage: unrar command -switch1 -switchN archive files...
$ unrar --help | grep del
$ unrar --help | grep unlink
$ unrar --help | grep rem


... no mention of removing anything.






share|improve this answer































    0














    I guess you could do something like





    • Use Process class to execute rar.exe


    • Process.WaitForExit



    • Validate whether the files have been extracted



      (You could just estimate size, if you want to do it quick and dirty...)



    • If validation passes, delete the archive








    share|improve this answer























      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%2f785415%2fwinrar-using-rar-exe-command-line-to-extract-all-files-in-all-archives-in-a-fo%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0















      Seems like those may only for deleting the files if you're adding them to an archive.




      Seems to be the case, yes,




      $ unrar --help | grep -i unrar
      UNRAR 5.00 beta 8 freeware Copyright (c) 1993-2013 Alexander Roshal
      Usage: unrar command -switch1 -switchN archive files...
      $ unrar --help | grep del
      $ unrar --help | grep unlink
      $ unrar --help | grep rem


      ... no mention of removing anything.






      share|improve this answer




























        0















        Seems like those may only for deleting the files if you're adding them to an archive.




        Seems to be the case, yes,




        $ unrar --help | grep -i unrar
        UNRAR 5.00 beta 8 freeware Copyright (c) 1993-2013 Alexander Roshal
        Usage: unrar command -switch1 -switchN archive files...
        $ unrar --help | grep del
        $ unrar --help | grep unlink
        $ unrar --help | grep rem


        ... no mention of removing anything.






        share|improve this answer


























          0












          0








          0








          Seems like those may only for deleting the files if you're adding them to an archive.




          Seems to be the case, yes,




          $ unrar --help | grep -i unrar
          UNRAR 5.00 beta 8 freeware Copyright (c) 1993-2013 Alexander Roshal
          Usage: unrar command -switch1 -switchN archive files...
          $ unrar --help | grep del
          $ unrar --help | grep unlink
          $ unrar --help | grep rem


          ... no mention of removing anything.






          share|improve this answer














          Seems like those may only for deleting the files if you're adding them to an archive.




          Seems to be the case, yes,




          $ unrar --help | grep -i unrar
          UNRAR 5.00 beta 8 freeware Copyright (c) 1993-2013 Alexander Roshal
          Usage: unrar command -switch1 -switchN archive files...
          $ unrar --help | grep del
          $ unrar --help | grep unlink
          $ unrar --help | grep rem


          ... no mention of removing anything.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 20 '14 at 9:26









          HannuHannu

          4,1751925




          4,1751925

























              0














              I guess you could do something like





              • Use Process class to execute rar.exe


              • Process.WaitForExit



              • Validate whether the files have been extracted



                (You could just estimate size, if you want to do it quick and dirty...)



              • If validation passes, delete the archive








              share|improve this answer




























                0














                I guess you could do something like





                • Use Process class to execute rar.exe


                • Process.WaitForExit



                • Validate whether the files have been extracted



                  (You could just estimate size, if you want to do it quick and dirty...)



                • If validation passes, delete the archive








                share|improve this answer


























                  0












                  0








                  0







                  I guess you could do something like





                  • Use Process class to execute rar.exe


                  • Process.WaitForExit



                  • Validate whether the files have been extracted



                    (You could just estimate size, if you want to do it quick and dirty...)



                  • If validation passes, delete the archive








                  share|improve this answer













                  I guess you could do something like





                  • Use Process class to execute rar.exe


                  • Process.WaitForExit



                  • Validate whether the files have been extracted



                    (You could just estimate size, if you want to do it quick and dirty...)



                  • If validation passes, delete the archive









                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 15 '15 at 5:22









                  NekyoNekyo

                  1




                  1






























                      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%2f785415%2fwinrar-using-rar-exe-command-line-to-extract-all-files-in-all-archives-in-a-fo%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

                      Probability when a professor distributes a quiz and homework assignment to a class of n students.

                      Aardman Animations

                      Are they similar matrix