Computer Hope
Microsoft => Microsoft DOS => Topic started 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
@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
-
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.
-
i did not find anything did you? ???
-
Where did you look?
-
FOR /F "tokens=5" %%i IN (listfile.txt) DO unrar e %%i *.* && del "%%i*.*"
The "%%i*.*" Might work? Have not tested.
-
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?
-
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
-
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
........del snoopdigitalmagno1.*.rar
is not correct right? beause i dont want to type my files name everytime. program should detect file names automatically
===============================
-
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]
-
http://www.extractnow.com/
-
http://www.extractnow.com/
Command line?
-
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.
-
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?
-
any other help please? ???
it doesn't seem to be so hard . at least for you professionals ::)
-
You shoot somebody down, and then expect the rest of us to jump in to help?
-
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.
-
-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.
-
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.
-
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.
-
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.
-
I need to apologize, I'm just a little bit cranky it seems.
It is not you that needs to apologise. (UK spelling)
-
-df switch will delete files after archiving.
dear ghostdog74
i dont want to delet after archiving !!!
i want to delet after extraction
-
dear ghostdog74
i dont want to delet after archiving !!!
i want to delet after extraction
We know ::)
-
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!
-
now please help!
It's not that simple.
-
do you want me to beg you?
-
why can't you just use del ? come on, try to put in some effort !
-
dear ghostdog74
please read my first post carefully !!
you can see that there is a del command
-
dear ghostdog74
please read my first post carefully !!
you can see that there is a del command
::)
-
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?
-
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 :)
-
sorry
can you show me the correct way? ;)
already shown. read my post carefully. I said don't use && together with your unrar command.
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.
-
ok i removed && and still it did not delet all parts !! :-[
-
it's possible please test it before type it in here
[Removed]
-
Language.......