Computer Hope

Microsoft => Microsoft DOS => Topic started by: mioo_sara on July 24, 2009, 01:51:29 AM

Title: delet multi part compressed files after extracting
Post by: mioo_sara 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
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout 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.
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara on July 24, 2009, 03:52:28 AM
i did not find anything did you? ???
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout on July 24, 2009, 04:10:03 AM
Where did you look?
Title: Re: delet multi part compressed files after extracting
Post by: billrich 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.
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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?
Title: Re: delet multi part compressed files after extracting
Post by: billrich 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
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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
===============================
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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]
Title: Re: delet multi part compressed files after extracting
Post by: BC_Programmer on July 24, 2009, 10:14:12 AM
http://www.extractnow.com/
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout on July 24, 2009, 10:26:27 AM
http://www.extractnow.com/

Command line?
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout 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.




Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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?
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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 ::)
Title: Re: delet multi part compressed files after extracting
Post by: Quantos on July 26, 2009, 02:06:03 AM
You shoot somebody down, and then expect the rest of us to jump in to help?
Title: Re: delet multi part compressed files after extracting
Post by: gh0std0g74 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.
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout 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.
Title: Re: delet multi part compressed files after extracting
Post by: Quantos 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.
Title: Re: delet multi part compressed files after extracting
Post by: gh0std0g74 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.
Title: Re: delet multi part compressed files after extracting
Post by: Quantos 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.
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout 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)

Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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

   
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout 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  ::)
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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!
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout on July 26, 2009, 05:49:48 AM
now  please  help!

It's not that simple.

Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara on July 26, 2009, 05:52:31 AM
do  you  want  me  to  beg you?
Title: Re: delet multi part compressed files after extracting
Post by: gh0std0g74 on July 26, 2009, 06:22:18 AM
why can't you just use del ? come on, try to put in some effort !
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout 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

 ::)
Title: Re: delet multi part compressed files after extracting
Post by: gh0std0g74 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?
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara 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 :)
Title: Re: delet multi part compressed files after extracting
Post by: gh0std0g74 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.
Title: Re: delet multi part compressed files after extracting
Post by: mioo_sara on July 27, 2009, 02:29:30 AM
ok i removed && and  still  it did not delet all parts !! :-[
Title: Re: delet multi part compressed files after extracting
Post by: Salmon Trout on July 27, 2009, 02:56:26 AM
Quote
it's possible please test it before type it in here

[Removed]
Title: Re: delet multi part compressed files after extracting
Post by: Carbon Dudeoxide on July 29, 2009, 04:48:24 AM
Language.......