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 8980 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.