7-Zip 명령 줄 : 자동 / 자동으로 추출 [중복]

가능한 중복 :
7-Zip 출력을 비활성화하는 방법은 무엇입니까?

7z.exe명령 프롬프트에서 아카이브를 자동 / 자동 추출하기 위해 사용하고 싶습니다 . 타사 스크립트 또는 API를 사용하고 싶지 않습니다. 7-Zip은 조용한 명령 줄 추출을 기본적으로 지원합니까?



답변

7-Zip에는 명령 줄 추출을위한 명시 적 “자동”또는 “자동”모드가 없습니다.

7-Zip 파일 “silently”-명령 줄 옵션을 추출하는 Stack Overflow에서 비슷한 질문 은 Python 스크립팅 코드를 사용하여 가능한 솔루션을 제공합니다.

한 가지 가능성은 popen을 사용하여 자식 프로세스를 생성하는 것이므로 출력은 부모로 돌아와서 처리되거나 표시되거나 (원하는 경우) 완전히 무시됩니다 (stdout = PIPE 및 stderr = PIPE로 popen 객체 생성 가능 자식에서 출력을 검색하려면).

그런 다음 슈퍼 사용자와 비슷한 질문입니다 . .7z 파일을 추출 할 때 Windows에서 7-Zip의 명령 줄 출력을 Windows에서 / dev / null로 리디렉션 하면 문제가 대부분 출력이며 NULL로 출력하면 시스템을 본질적으로 자동으로 실행하십시오.

이것을 시도하십시오 :

% COMSPEC % / c “% ProgramFiles % \ 7-Zip \ 7z.exe”…


답변

예, 명령 줄 사용을 지원합니다. 명령 프롬프트를 열고 설치 폴더 (일반적으로 C : \ Program Files \ 7-Zip)로 이동 한 후 다음을 입력하십시오.

7z -h

결과는 다음과 같습니다.

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries

자동 추출의 한 예는 다음과 같습니다.

7z x "C:\Path\To\File.zip" -y > nul


답변