
C:\Temp
특정 하위 폴더(예: ) 없이 폴더를 압축하고 싶습니다 C:\Temp\test
. 7zip으로 어떻게 할 수 있나요?
나는 다음 명령을 생각해 냈습니다.
c:\Temp>7zip a -t7z test.7z c:\temp\ -mx0 -x!c:\temp\test\*
하지만 출력이 다음과 같으므로 작동하지 않습니다.
7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Scanning
Updating archive test.7z
Compressing Temp\admin.PNG
Compressing Temp\test\admin2.PNG <<<<<< this file should not be added to the archive
Compressing Temp\first.txt
답변1
내 시스템에서 테스트한 결과:
7zip a -t7z -mx0 -x!test\* test.7z c:\temp\
소스 디렉터리에 있는 경우 파일은 상대 경로로 저장되므로 테스트 폴더는 가 test\file1.txt
아닌 처럼 보입니다 c:\temp\test\file1.txt
.
-mx0 스위치를 사용하면 파일을 압축하는 것이 아니라 전체 크기로 아카이브에 복사하는 것뿐입니다.