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

Author Topic: delet multi part compressed files after extracting  (Read 8639 times)

0 Members and 1 Guest are viewing this topic.

mioo_sara

    Topic Starter


    Intermediate

    delet multi part compressed files after extracting
    « on: July 24, 2009, 01:51:29 AM »
    hi there to  all
    a few  month  ago i  asked  about  extracting  and  then  deletion  of  compressed  files  and  dear RENO gaved  me some  good  scripts.
    below  you  can  see  my  batch  scripts

    Quote
    @echo off
    setlocal enabledelayedexpansion
    DIR /A-D /X *.rar | FIND "part" > listfile.txt
    FOR /F "tokens=5" %%i IN (listfile.txt) DO unrar e %%i *.* && del "%%i"

    but now i have  another problem  again !! well  with  my  normal  batch  code i can  unpack  and  delet all  zip  or  rar files  easily but problem  occurs  when  we  have  multi part  rar files look  at  example  below


    snoopdigitalmagno1.part1.rar
    snoopdigitalmagno1.part2.rar
    snoopdigitalmagno1.part3.rar
    snoopdigitalmagno1.part4.rar

    as  you  can  see  our  file  has  divided  into  4  parts with  my  batch  codes  i just  can  delet  1st (first) part  and  not  all.  it  always  remains  other parts undeleted why?
    how  can  i solve  this  problem?

    attention:
    1-first part always delet (red one)
    2-this is just an  example so  never focus on  that
    3-do you  think  (part) word in  my scripts is  a good  choice?
    4- it is a possibility  that  there are lots of  compressed rar files  so we should  focus (for deletion) on  just  those  one  that  are  unpacked successfully  not  broken  ones  or those  that  we  are  not  going  to  unzip

    Salmon Trout

    • Guest
    Re: delet multi part compressed files after extracting
    « Reply #1 on: July 24, 2009, 02:50:34 AM »
    Doesn't unrar.exe have a command line switch that deletes the whole archive (single or multipart) after successful extraction? I know that rar.exe (the command line program that comes with winrar) does. Viewing the documentation will tell you.
    « Last Edit: July 24, 2009, 03:21:12 AM by Salmon Trout »

    mioo_sara

      Topic Starter


      Intermediate

      Re: delet multi part compressed files after extracting
      « Reply #2 on: July 24, 2009, 03:52:28 AM »
      i did not find anything did you? ???

      Salmon Trout

      • Guest
      Re: delet multi part compressed files after extracting
      « Reply #3 on: July 24, 2009, 04:10:03 AM »
      Where did you look?

      billrich

      • Guest
      Re: delet multi part compressed files after extracting
      « Reply #4 on: July 24, 2009, 05:37:38 AM »
      FOR /F "tokens=5" %%i IN (listfile.txt) DO unrar e %%i *.* && del "%%i*.*"


      The  "%%i*.*" Might work?  Have not tested.

      mioo_sara

        Topic Starter


        Intermediate

        Re: delet multi part compressed files after extracting
        « Reply #5 on: July 24, 2009, 05:52:03 AM »
        Quote
        Where did you look?

        i  tried  all  the winrar's switches . one  by  one  but  no  one  helped !!  there  is  some  switches  for  deletion  but  they  delet  files  after compressing  not  extraction !!!

        no  dear  billrich ???
        it  did not  solved  the  problem !  it still  unpack  file  correctly  but  just  first  part  is  deleted !! others  are  existed  again
        what's  wrong?

        billrich

        • Guest
        Re: delet multi part compressed files after extracting
        « Reply #6 on: July 24, 2009, 06:10:30 AM »
        FOR /F "tokens=5" %%i IN (listfile.txt) DO unrar e %%i *.* && del "%%i  && del  snoopdigitalmagno1.*.rar

         or


        FOR /F "tokens=5" %%i IN (listfile.txt) DO unrar e %%i *.* && del "%%i  && del  %%i*.rar

        mioo_sara

          Topic Starter


          Intermediate

          Re: delet multi part compressed files after extracting
          « Reply #7 on: July 24, 2009, 09:17:48 AM »
          none of codes worked ! :o this time  just  file  extracted  and  no  file  were  deleted ! NOT  EVEN  FIRST  PART
          but  billrich  i think maybe i could  not  mention my  words  correctly. as  i said  in  post  number 1 (look  at attention paragraph line #2)
          this  question  is  just  an  example  and  i'm  looking  for  a pattern so  i think
          Quote
          ........del  snoopdigitalmagno1.*.rar
          is not correct  right? beause  i dont  want  to  type  my  files  name  everytime. program  should  detect  file  names  automatically
          ===============================

          mioo_sara

            Topic Starter


            Intermediate

            Re: delet multi part compressed files after extracting
            « Reply #8 on: July 24, 2009, 09:19:06 AM »
            THIS INSTRUCTION  IS  JUST  FOR  LEARNING  HOW  TO  COMPRESS AND  DIVID FILE  INTO  MULTI PARTS

            please before  type  any  further  answer read  this  few  lines carefully

            1-first find  a file (at leat 5 mb) example= a movie clip or something
            2-compress it  with  winrar  and  as you  can  see in  picture  below split file into  multi parts
            3- copy  my  script in  first  post  into a new.bat file and copy  bat file next to  multi part compressed file
            4-  now  test and  try  to  find  a way

            thanks

            [attachment deleted by admin]

            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
            I was trying to dereference Null Pointers before it was cool.


            Salmon Trout

            • Guest
            Re: delet multi part compressed files after extracting
            « Reply #11 on: July 24, 2009, 11:17:04 AM »
            Some points:

            1. By default, WinRAR creates multipart rar archives with certain naming conventions. The part numbers are padded with leading zeroes if there will be more than 10, 100 etc.

            2. You only need to extract from part1.rar/part01.rar/part001.rar - the following parts are automatically selected.

            3. Thus if you try to extract from any one of the following part2.rar - partN.rar parts, you will be extracting everything all over again.

            4. There is an older naming convention where the first part is called XXX.rar and subsequent parts are called XXX.r00, XXX.r01, etc

            5. You can select the above behaviour by running WinRAR.exe from its C:\Program Files\WinRAR folder, and editing the default profile in -

             'options' / 'settings' / 'advanced' / 'create default profile' / check 'old style volume names'

            6. Then you only have to find 1 file with a .rar extension for each archive.





            mioo_sara

              Topic Starter


              Intermediate

              Re: delet multi part compressed files after extracting
              « Reply #12 on: July 24, 2009, 01:47:51 PM »
              thanks  dear Salmon Trout  for the points :)
              but  i think your above sentences are just for  extracting and  renaming . well  if you  use  my  batch  script you  can  see that extraction  and  renaming  is doing  very  well  without any  problem  . i just have one last job  undone and  it's deletion
              how  should we delet multipart compressed files after extraction?

              mioo_sara

                Topic Starter


                Intermediate

                Re: delet multi part compressed files after extracting
                « Reply #13 on: July 26, 2009, 01:57:46 AM »
                any  other help  please? ???
                it doesn't seem  to  be so hard . at least for  you  professionals ::)

                Quantos



                  Guru
                • Veni, Vidi, Vici
                • Thanked: 170
                  • Yes
                  • Yes
                • Computer: Specs
                • Experience: Guru
                • OS: Linux variant
                Re: delet multi part compressed files after extracting
                « Reply #14 on: July 26, 2009, 02:06:03 AM »
                You shoot somebody down, and then expect the rest of us to jump in to help?
                Evil is an exact science.

                gh0std0g74



                  Apprentice

                  Thanked: 37
                  Re: delet multi part compressed files after extracting
                  « Reply #15 on: July 26, 2009, 02:40:39 AM »
                  any  other help  please? ???
                  it doesn't seem  to  be so hard . at least for  you  professionals ::)

                  you are not looking hard enough. open up winrar, go to Help->Help topics. from there go to Command line mode. the -df switch will delete files after archiving.

                  Salmon Trout

                  • Guest
                  Re: delet multi part compressed files after extracting
                  « Reply #16 on: July 26, 2009, 03:01:18 AM »
                  -df switch will delete files after archiving.

                  Very good. However, the OP has precisely the opposite requirement, namely the deletion of all parts of a multipart archive after successful extraction.

                  However the OP's attitude may prove to be a deterrent to suggestions for dealing with this quite easy task.

                  Quantos



                    Guru
                  • Veni, Vidi, Vici
                  • Thanked: 170
                    • Yes
                    • Yes
                  • Computer: Specs
                  • Experience: Guru
                  • OS: Linux variant
                  Re: delet multi part compressed files after extracting
                  « Reply #17 on: July 26, 2009, 03:04:55 AM »
                  Very good. However, the OP has precisely the opposite requirement, namely the deletion of all parts of a multipart archive after successful extraction.

                  However the OP's attitude may prove to be a deterrent to suggestions for dealing with this quite easy task.


                  After what I've seen I don't think the OP deserves help at all.
                  Evil is an exact science.

                  gh0std0g74



                    Apprentice

                    Thanked: 37
                    Re: delet multi part compressed files after extracting
                    « Reply #18 on: July 26, 2009, 04:22:55 AM »
                    Very good. However, the OP has precisely the opposite requirement, namely the deletion of all parts of a multipart archive after successful extraction.

                    then that doesn't really need any switches at all, just normal OS del.
                    and yes, i forgot its mio_sara we are talking here.

                    Quantos



                      Guru
                    • Veni, Vidi, Vici
                    • Thanked: 170
                      • Yes
                      • Yes
                    • Computer: Specs
                    • Experience: Guru
                    • OS: Linux variant
                    Re: delet multi part compressed files after extracting
                    « Reply #19 on: July 26, 2009, 04:27:09 AM »
                    After what I've seen I don't think the OP deserves help at all.

                    I need to apologize, I'm just a little bit cranky it seems.
                    Evil is an exact science.

                    Salmon Trout

                    • Guest
                    Re: delet multi part compressed files after extracting
                    « Reply #20 on: July 26, 2009, 04:29:20 AM »
                    I need to apologize, I'm just a little bit cranky it seems.

                    It is not you that needs to apologise. (UK spelling)


                    mioo_sara

                      Topic Starter


                      Intermediate

                      Re: delet multi part compressed files after extracting
                      « Reply #21 on: July 26, 2009, 05:24:23 AM »
                      Quote
                      -df switch will delete files after archiving.


                      dear ghostdog74

                      i dont  want to delet after archiving !!!
                      i want to delet after extraction

                         

                      Salmon Trout

                      • Guest
                      Re: delet multi part compressed files after extracting
                      « Reply #22 on: July 26, 2009, 05:25:24 AM »


                      dear ghostdog74

                      i dont  want to delet after archiving !!!
                      i want to delet after extraction

                         

                      We know  ::)

                      mioo_sara

                        Topic Starter


                        Intermediate

                        Re: delet multi part compressed files after extracting
                        « Reply #23 on: July 26, 2009, 05:47:58 AM »
                        apologize? me? ???
                        ok  sorry  i apologize every one specially  my  dear friends billrich and Salmon Trout

                        i think  there is  a big misunderstanding !!
                        maybe  because  i  am  not  american  and  english  is  my  second  language
                        now  please  help!

                        Salmon Trout

                        • Guest
                        Re: delet multi part compressed files after extracting
                        « Reply #24 on: July 26, 2009, 05:49:48 AM »
                        now  please  help!

                        It's not that simple.


                        mioo_sara

                          Topic Starter


                          Intermediate

                          Re: delet multi part compressed files after extracting
                          « Reply #25 on: July 26, 2009, 05:52:31 AM »
                          do  you  want  me  to  beg you?

                          gh0std0g74



                            Apprentice

                            Thanked: 37
                            Re: delet multi part compressed files after extracting
                            « Reply #26 on: July 26, 2009, 06:22:18 AM »
                            why can't you just use del ? come on, try to put in some effort !

                            mioo_sara

                              Topic Starter


                              Intermediate

                              Re: delet multi part compressed files after extracting
                              « Reply #27 on: July 26, 2009, 08:28:32 AM »
                              dear ghostdog74

                              please read my  first post carefully !!
                              you  can  see that  there is  a del command

                              Salmon Trout

                              • Guest
                              Re: delet multi part compressed files after extracting
                              « Reply #28 on: July 26, 2009, 09:25:16 AM »
                              dear ghostdog74

                              please read my  first post carefully !!
                              you  can  see that  there is  a del command

                               ::)

                              gh0std0g74



                                Apprentice

                                Thanked: 37
                                Re: delet multi part compressed files after extracting
                                « Reply #29 on: July 26, 2009, 06:16:55 PM »
                                dear ghostdog74

                                please read my  first post carefully !!
                                you  can  see that  there is  a del command
                                so ? you are using del , yes its true, but you are using it incorrectly. if its multipart, you have to wait for unrar unzips all the files before you del them. so why the  && together with your unrar command?

                                mioo_sara

                                  Topic Starter


                                  Intermediate

                                  Re: delet multi part compressed files after extracting
                                  « Reply #30 on: July 26, 2009, 10:49:44 PM »
                                  Quote
                                  so ? you are using del , yes its true, but you are using it incorrectly

                                  sorry
                                  can  you  show  me the correct way? ;)
                                  can  you  write a correct code? and if it's possible please test it before type it in here
                                  thanks :)

                                  gh0std0g74



                                    Apprentice

                                    Thanked: 37
                                    Re: delet multi part compressed files after extracting
                                    « Reply #31 on: July 26, 2009, 11:20:53 PM »
                                    sorry
                                    can  you  show  me the correct way? ;)
                                    already shown. read my post carefully. I said don't use && together with your unrar command.

                                    Quote
                                    can  you  write a correct code? and if it's possible please test it before type it in here
                                    thanks :)
                                    no way. do it yourself.

                                    mioo_sara

                                      Topic Starter


                                      Intermediate

                                      Re: delet multi part compressed files after extracting
                                      « Reply #32 on: July 27, 2009, 02:29:30 AM »
                                      ok i removed && and  still  it did not delet all parts !! :-[

                                      Salmon Trout

                                      • Guest
                                      Re: delet multi part compressed files after extracting
                                      « Reply #33 on: July 27, 2009, 02:56:26 AM »
                                      Quote
                                      it's possible please test it before type it in here

                                      [Removed]
                                      « Last Edit: July 29, 2009, 04:48:18 AM by Carbon Dudeoxide »

                                      Carbon Dudeoxide

                                      • Global Moderator

                                      • Mastermind
                                      • Thanked: 169
                                        • Yes
                                        • Yes
                                        • Yes
                                      • Certifications: List
                                      • Experience: Guru
                                      • OS: Mac OS
                                      Re: delet multi part compressed files after extracting
                                      « Reply #34 on: July 29, 2009, 04:48:24 AM »
                                      Language.......