7zip

Zipping a folder using 7-Zip from an asp page

北城以北 提交于 2019-12-24 09:33:07
问题 I am trying to zip a folder from an asp page. This is my code: zipFolderName=folderName &"Zipped.zip" command="cd C:\Program Files\7-Zip & " command = command & "7z a -tzip " & zipFolderName & " """ & folderName & """" Response.Write command set objshell = Server.CreateObject("WScript.shell") objShell.exec (command) set objshell=nothing The command that is written in the Response.Write is cd C:\Program Files\7-Zip & 7z a -tzip D:/saveAll/DocumentsZipped.zip "D:/saveAll/Documents" When I run

Python error: Cannot find the file specified

十年热恋 提交于 2019-12-24 07:52:32
问题 This is my body of code: os.chdir("C:\\Users\\Desktop") rc = subprocess.call(['7z', 'a', 'test', '-y', 'myarchive.zip'] + [r'device teams.txt']) It gives me an error pointing to r'device teams.txt' saying the specified file does not exist. I checked the directory and it is in the desktop directory so I am not sure why it is giving me this error 回答1: Based on your comments, the problem isn't the txt file path, it's that the command 7z cannot be found. You can check this by just calling rc =

detecting if a file is an archive using 7zip

末鹿安然 提交于 2019-12-24 03:35:12
问题 I would like to use SevenZipSharp in order to determine if a file is an archive. I know that it's possible because in explorer if I rename a .zip to .bmp, 7zip still recognises it as an archive. --edit: In other words, I want 7zip to tell me if a file (no matter the extension) contains some kind of supported archive (zip, tar, rar, iso etc.) Thanks, Fidel 回答1: static bool IsArchive(string filename) { bool result = false; try { new ArchiveFile(File.OpenRead(filename)); result = true; } catch {

How to delete a file from multiple zip archives using 7-Zip

岁酱吖の 提交于 2019-12-23 19:18:01
问题 I have a thousand zip archives that all contain a file I want to remove. I can get 7Zip to remove them one file at a time from the command line: 7z d -r archive.zip *.pdf but how would I apply that across all the files, which are themselves grouped in sub-directories? 回答1: Try this: for /r %v in (*.zip) do 7z d -r "%v" *.pdf But no idea if it's working, just wrote out of my head :P 回答2: FOR /F "tokens=*" %%G IN ('dir /b *.zip') DO 7z.exe d -r %%G *.pdf This works almost in the same way as the

Invoke executable (w/parameters) from powershell script

寵の児 提交于 2019-12-23 15:28:02
问题 I'm calling a zip utility from powershell and having a difficult time getting its parameters straight. Here's the code: if (-not (test-path "C:\Program Files (x86)\7-Zip\7z.exe")) {throw "C:\Program Files (x86)\7-Zip\7z.exe needed"} set-alias sz "C:\Program Files (x86)\7-Zip\7z.exe" $argument_1 = "c:\temp\DeployTemp\" $argument_0 = "c:\temp\Release\Web_Feature_2012R10_1_1112.prod.com.zip" sz x $argument_0 -o$argument_1 The problem is the 7zip executable call literally extracts to a directory

Cannot compile 7zip under MSVC2012

只愿长相守 提交于 2019-12-23 12:14:22
问题 I cannot compile 7zip under MSVC2012. When i type: C:\7zsrc> nmake NEW_COMPILER=1 MY_STATIC_LINK=1 Build.mak I get this: Microsoft (R) Program Maintenance Utility Version 11.00.50727.1 Copyright (C) Microsoft Corporation. All rights reserved. link -nologo -OPT:REF -OPT:ICF /LARGEADDRESSAWARE -out:O\ oleaut32.li b ole32.lib user32.lib advapi32.lib shell32.lib LINK : fatal error LNK1104: cannot open file 'O\' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0 \VC

encrypt binary with 7z without filenames?

浪尽此生 提交于 2019-12-23 05:26:37
问题 I am wondering, i like 7z compression but how do i compress data only? i dont want a file in the archive with file info. Just raw data, how can i do this? it would also be nice if i can remove headers too but that isnt necessary. 回答1: From man 7z: -si Read data from StdIn (eg: tar cf - directory | 7z a -si directory.tar.7z) 来源: https://stackoverflow.com/questions/1284088/encrypt-binary-with-7z-without-filenames

Extract zip contents into directory with same name as zip file, retain directory structure

佐手、 提交于 2019-12-23 02:32:33
问题 I would like to write a bat script to do the following: Use 7 Zip to extract files from an existing zip file, into a folder by the same name as the original zip file (bar the .zip extension), and keeping the file & directory structure that was contained in the zip file. I can extract all the same files into the current directory, by using "C:\Program Files (x86)\7-Zip\7z.exe" e myZipFile.zip 回答1: Reading the help of the 7z -command by just typing "C:\Path To\7-Zip\7z.exe" gets the help with

How pip install pylzma on windows 7 x64 , python 2.7

隐身守侯 提交于 2019-12-22 18:37:09
问题 I assumed this should be working out of the box, but ... i've pasted pip.log on pastbin the last few lines of error message is e:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWITH_COMPAT=1 -DCOMPRESS_MF_MT=1 -Isrc/sdk -IC:\Python27\include -IC:\Python27\PC /Tcsrc\7zip\C\AesOpt.c /Fobuild\temp.win-amd64-2.7\Release\src\7zip\C\AesOpt.obj /MT cl : Command line warning D9025 : overriding '/MD' with '/MT' AesOpt.c src\7zip\C\AesOpt.c(14

using 7zip sdk to compress a file, but can not decompress using winrar or 7zip

五迷三道 提交于 2019-12-22 08:46:26
问题 I downloaded the SDK 7zip from here. Then I used this code to compress a file to 7zip: private static void CompressFileLZMA(string inFile, string outFile) { Encoder coder = new SevenZip.Compression.LZMA.Encoder(); using (FileStream input = new FileStream(inFile, FileMode.Open)) using (FileStream output = new FileStream(outFile, FileMode.Create)) { coder.Code(input, output, -1, -1, null); output.Flush(); } } I tried both the SDK versions 9.20 and 9.22 beta on the site. The compression seems