7zip

7z command line to compress folders

时光总嘲笑我的痴心妄想 提交于 2019-12-04 10:33:45
I am trying to zip/7z folders using the command line of 7zG.exe. The code I have works for files but not folders. Could someone please show me the correct way using 7z command line to compress folders? Here is the sample code that works for files only. Whenever I try running this code 7zip shows a messagebox saying "Invalid Parameter" string sourceName = "Folder\Folder1"; string targetName = "Example.gz"; // 1 // Initialize process information. // ProcessStartInfo p = new ProcessStartInfo(); p.FileName = "7zG.exe"; // 2 // Use 7-zip // specify a=archive and -tgzip=gzip // and then target file

Is there an equivalent of gzip.open() for .7z files?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 05:41:29
I have to frequently search through a couple of .7z (zipped with LZMA) files. I don't have enough memory to have them unpacked at the same time or to change the archive to .gz. At the moment I unpack one, search for what I need, delete what was extracted, unpack the next. I want to go through the archives in the same way as with gzip: f = gzip.open('archive.gz') for i in f: do stuff Is there a module/way to do this with .7z files? There is a built in module in Python >= 3.3: http://docs.python.org/3.3/library/lzma And there is also a backport of the module on the PyPI: https://pypi.python.org

7zip Self Extracting Archive (SFX) without administrator privileges

天涯浪子 提交于 2019-12-04 03:28:53
I use 7zip to create the SFX as follows: 7z.exe a -r archive.7z * Then I do a binary copy with the 7zS.sfx file (used to create a self extracting installer), config file "build.config", and the archive. The contents of config file are as follows: ;!@Install@!UTF-8! RunProgram="setup.exe" GUIMode="1" Path="%tmp%\\mytemp" ;!@InstallEnd@! Binary copy command is as follows: copy /b 7zS.sfx + build.config + archive.7z sfxInstaller.exe Problem is that the result SFX "sfxInstaller.exe" requires admin privileges for executing. Is it possible to generate Self Extracting Archives using 7-Zip that do not

Batch file to compress subdirectories

◇◆丶佛笑我妖孽 提交于 2019-12-03 16:30:52
I am trying to write a batch script that will run automatically compressing subdirectories using winrar or 7-zip: Example: My Pictures Pics1 (Pics1.zip) File1.jpg File2.jpg File3.jpg Pics2 (Pics2.zip) File4.jpg File5.jpg Pics3 (Pics3.zip) File6.jpg File7.jpg ... How do i write script. (1) Using WinRAR: WinRAR includes two command-line tools, rar.exe and unrar.exe , where rar.exe compresses and unrar.exe uncompresses files. Both are located in the C:\Program Files\WinRAR folder in the installable version. Assuming, if there are multiple subfolders under C:\MyPictures and you want each subfolder

Extracting a 7-Zip file “silently” - command line option

点点圈 提交于 2019-12-03 14:35:40
问题 I want to extract a 7-Zip archive in a Python script. It works fine except that it spits out the extraction details (which is huge in my case). Is there a way to avoid this verbose information while extracting? I did not find any "silent" command line option to 7z.exe . My command is 7z.exe -o some_dir x some_archive.7z 回答1: One possibility would be to spawn the child process with popen, so its output will come back to the parent to be processed/displayed (if desired) or else completely

Invoke-Expression with exe in Program Files

烈酒焚心 提交于 2019-12-03 11:29:50
I'm trying to run a Powershell command to call 7-Zip to zip up a folder using the following command: $command = $SevenZip + " a " + $targetDirForZip + $GetDateName + "_" + $dir.Name + ".7z " + $dir.FullName Invoke-Expression $command The variables being fed into $command are already set and $SevenZip is "c:\Program Files\7-Zip\7z.exe" This isn't working and I'm trying to work out the best way to call 7-Zip from Powershell. Ideas? I've had the same problem before. This is code (almost) straight from a backup script that I use currently: [string]$pathToZipExe = "C:\Program Files\7-zip\7z.exe";

7-Zip: Any good tutorials? [closed]

天大地大妈咪最大 提交于 2019-12-03 10:18:59
I'm thinking about using the 7-Zip format to pack my application files since it's a very compact and popular format. I can't find some tutorials on how to use the C++ SDK, though. I'd like some tutorials that teach me how to: Open an archive from memory (buffer) instead of directly from disk. Extract individual files inside the archive, to buffer, not to disk. Check if a certain file can be found in the archive. From the LMZA SDK documentation: ANSI-C LZMA Decoder ~~~~~~~~~~~~~~~~~~~ Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58. If you want to use old interfaces

random seek in 7z single file archive

夙愿已清 提交于 2019-12-03 09:03:07
Is it possible to do random access (a lot of seeks) to very huge file, compressed by 7zip? The original file is very huge (999gb xml) and I can't store it in unpacked format (i have no so much free space). So, if 7z format allows accessing to middle block without uncompressing all blocks before selected one, I can built an index of block beginning and corresponding original file offsets. Header of my 7z archive is 37 7A BC AF 27 1C 00 02 28 99 F1 9D 4A 46 D7 EA // 7z archive version 2;crc; n.hfr offset 00 00 00 00 44 00 00 00 00 00 00 00 F4 56 CF 92 // n.hdr offset; n.hdr size=44. crc 00 1E 1B

Compressing only files using 7z without preserving the path

白昼怎懂夜的黑 提交于 2019-12-03 08:12:33
问题 I am using 7z command line executable to zip files, but I see that while adding to an archive the path of the files is preserved in the archive. So if I do 7z a -tzip myzip.zip dir1\dir2\* the archive myzip.zip will contain the path dir1\dir2. I do not want this, rather I want only the files to be added to the zip file without the paths being preserved. I searched quite a bit but do not seem to find any way of doing this, maybe I am missing something obvious? Thanks 回答1: Give the full path.

Converting .bat to .exe with no additional external software (Create SFX)

浪尽此生 提交于 2019-12-03 06:18:34
问题 Following the same steps as this guide. I am trying to convert from bat to exe without installing any new software such as Bat to Exe Converter. The reason I am using this method is because all machines in my workplace already have 7zip installed and can use it, however I am not allowed to make the script work using external software not present on the main server to be compatible on any machine in the company. I have the following TEST.bat : ECHO This is a Test bat to exe pause and the