Closed Thread Icon

Topic awaiting preservation: Need help with 7-Zip command line (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=31693" title="Pages that link to Topic awaiting preservation: Need help with 7-Zip command line (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Need help with 7-Zip command line <span class="small">(Page 1 of 1)</span>\

 
d_a_r_k
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Feb 2010

posted posted 02-24-2010 22:52

Hi, guys. I'm new to this forum. I have a question. Is it possible to make batch file search for specified archive and 7za.exe paths on the computer so when it does find the paths, write them to temporary .txt file, then insert the archive path directly to 7-Zip command line for extraction (so it would know from where to extract from). And then insert 7za.exe path (so it would know where extract to)?

Thanks in advance.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-25-2010 03:00
quote:

d_a_r_k said:

and 7za.exe paths on the computer



what do you mean by that part? The path to 7-zip?

If so, then if 7zip is part of your environment variables, then you don't need to specify the path to 7zip.
7zip has the ability to use what 7zip calls a filelist. It will hold the directories you want to use to zip up. you could have it find the files and then write them to the file list and then have 7zip use the filelist to run from.

Something like

code:
7z a -t7z -m0=lzma -mx=9 -mfb=64 -ms=on mybackup.7z @filelist



see where filelist is? That is an actual file called "filelist" It holds the directories that I want to include in the above line. They have to be separated each on a new line and in quotes

code:
"C:\mydirectory"



I have no idea how to search for the directories and write them to the file in a batch file though. Would probably be pretty easy to do in something like Python though.

btw : Welcome to the forums.

Later,

C:\

d_a_r_k
Obsessive-Compulsive (I) Inmate

From:
Insane since: Feb 2010

posted posted 02-25-2010 10:22

Thank you for your reply, CPrompt Unfortunately I get an error, maybe I did something wrong. Have a look

http://img35.imageshack.us/img35/8017/52705706.png

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-25-2010 14:20

so you are trying to extract the archive "basecontent" right? That's what the "x" switch does.

the x and e switch does not use the filelist, that is only used for what files and directories are used to make the compression.

So, is there a way to open and read a file in a batch file? I don't know batch stuff at all.
The command to extract would be

code:
7z x basecontent.7z -oc:\mydirectory



notice there is no space between the -o and the path to where you want to extract the files. You'll get an error if there is.

Maybe you can have the directory for extraction stored in a file? And then have the batch file read that file and put the directory into a variable to be passed to the 7z command? Like I said, I'm not a batch file guy but there are some here that are. Hopefully they will chime in and help out with that.

I am actually working on a Python program using 7zip which is funny that you pop in and ask a question about it

Later,

C:\

d_a_r_k
Obsessive-Compulsive (I) Inmate

From:
Insane since: Feb 2010

posted posted 02-25-2010 16:03

Is there a switch that would allow to point the path to the archive?
Also the -o swith works only if the destination folder has name without any spaces: e/g new folder (that won't work), newfolder (but this will work).



7z x c:\specified\input\path\basecontent.7z -od:\specified\output\path\new folder
pause

(Edited by d_a_r_k on 02-25-2010 16:06)

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-25-2010 18:23

that's because you need to place the path in quotes (
7z x c:\specified\input\path\basecontent.7z -o"d:\specified\output\path\new folder"
should work
or potentially
7z x c:\specified\input\path\basecontent.7z "-od:\specified\output\path\new folder"

d_a_r_k
Nervous Wreck (II) Inmate

From:
Insane since: Feb 2010

posted posted 02-25-2010 20:32
quote:

Tyberius Prime said:

that's because you need to place the path in quotes ( 7z x c:\specified\input\path\basecontent.7z -o"d:\specified\output\path\new folder"should workor potentially7z x c:\specified\input\path\basecontent.7z "-od:\specified\output\path\new folder"




Now that's what I'm talking about! Thank you Tyberius Prime. Now the last thing I wanna ask. Is there some kind of switch that would show extraction progress in percentage value, instead of flooding the whole window?



7-Zip (A) 9.10 beta Copyright (c) 1999-2009 Igor Pavlov 2009-12-22

Processing archive: test.7z

Extracting content\rar.txt
Extracting new\rar.txt
Extracting rar\rar.txt
Extracting content\readme.txt
Extracting new\readme.txt
Extracting rar\readme.txt
Extracting content\whatsnew.txt
Extracting new\whatsnew.txt
Extracting rar\whatsnew.txt
Extracting content\copying.emx
Extracting new\copying.emx
Extracting rar\copying.emx
Extracting content\rarfiles.lst
Extracting new\rarfiles.lst
Extracting rar\rarfiles.lst
Extracting content\copying.rsx
Extracting new\copying.rsx
Extracting rar\copying.rsx
Extracting content\emx.exe
Extracting new\emx.exe
Extracting rar\emx.exe
Extracting content\rar32.exe
Extracting new\rar32.exe
Extracting rar\rar32.exe
Extracting content\rsx.exe
Extracting new\rsx.exe
Extracting rar\rsx.exe
Extracting content\emx.dll
Extracting new\emx.dll
Extracting rar\emx.dll
Extracting content\default.sfx
Extracting new\default.sfx
Extracting rar\default.sfx
Extracting rar
Extracting new
Extracting content

Everything is Ok

Folders: 3
Files: 33
Size: 3461829
Compressed: 483636
Press any key to continue . . .

(Edited by d_a_r_k on 02-25-2010 20:34)

abidleo
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Jul 2010

posted posted 07-07-2010 14:25

Hello,

Here is the new version of 7 zip. Try it here . Download [Edit TP: Url removed. Use the official site http://www.7-zip.org/ not some spamy potentially dangerous third party site ]

(Edited by Tyberius Prime on 07-07-2010 17:01)

alice
Obsessive-Compulsive (I) Inmate

From:
Insane since: Sep 2010

posted posted 09-22-2010 06:57

I satisfy myself by wasting their time as much as possible, encouraging further communication while deliberately (but slyly) insulting them as much as possible.

In fact, it gives me greater pleasure than I could possibly admit when I get 'politely' confused responses to emails calling strongly suggesting that their parents are related, etc, etc. On one occasion I even received a kindly worded response refusing to part-exchange one of their family members - even though I'd promised them a comfortable position in the sex industry, and a daily salary in double figures. Despite my many lewd and offensive suggestions, they will still try to complete the deal, seemingly unaware that I'm taking the absolutely piss out of them.

(Edited by alice on 09-22-2010 06:58)

alice
Nervous Wreck (II) Inmate

From:
Insane since: Sep 2010

posted posted 09-22-2010 07:01

SO to celebrate I'm using a conker to start us off, I hope that's ok with you? I have not compressed the image at all or saved it as a PSD, you can find it here as a jpeg. I usually save my images as a PSD, RaR or ZIP them up. Do you have any preferences in format at all?
Good luck

alice

« BackwardsOnwards »

Show Forum Drop Down Menu