
나는 압축되지 않은 파일을 삭제하면서 디렉토리 아래에 있는 모든 디렉토리의 모든 html 파일을 gzip으로 압축하고 싶습니다.
for /r %%i in (*.html) do "c:\7-zip\7z.exe" a -aoa -mx=9 -tgzip -sdel "%%~ni.gz" "%%i"
이 명령줄은 부분적으로 작동하지만 해당 디렉토리의 각 HTML 파일을 gzip으로 압축하지 않고 대신 상위 디렉토리에서 모든 html 파일을 gzip으로 압축합니다.
내가 이렇게 하면
for /r %%i in (*.html) do "c:\7-zip\7z.exe" a -aoa -mx=9 -tgzip -sdel "%%i.gz" "%%i"
해당 디렉토리의 각 파일을 gzip으로 압축하지만 .html은 유지합니다.
나한테 해결책이 있어
for /r %%i in (*.html) do "c:\7-zip\7z.exe" a -aoa -mx=9 -tgzip -sdel "%%~pni.gz" "%%i"