Muszę skompresować plik do gunzip i wykonuje się go poleceniem poniżej
@echo off gzip -c C: temp1xx.out> C: temp2x2.out.gz
Ale moim pytaniem jest sprawdzenie wszystkich plików w kataloguktóry ma rozszerzenie .out i kompresuje każdy plik do pliku gunzip i usuwa ten sam plik po zakończeniu kompresji.
Odpowiedzi:
1 dla odpowiedzi № 1 rem Pick up each file in C:Temp1 with .out extension.
for %%a in ("C:temp1*.out") do (
rem Compress the file to a file with the same name but .gz extension is added.
gzip -c %%a > %%a.gz
rem Delete the .out file which has been already compressed.
del /F /Q %%a
)