Batch to Verify all files *.gz and delete the Bad GZ file
Posted: 14 Feb 2011 20:37
I try this but can not exist to command on FOR DO
FOR %%F in (D:\dnews\BAG\TEMP\*.gz) DO (C:\dnews\UTL\gzip -d "%%F") | (IF %ERRORLEVEL% EQU 1 DEL /S "%%F")
>> FOR %%F in (D:\dnews\BAG\TEMP\*.gz) DO (C:\dnews\UTL\gzip -d "%%F") = take each *.GZ file un-archive them
if get a ERR Run this (IF %ERRORLEVEL% EQU 1 DEL /S "%%F")
The >%ERRORLEVEL% EQU 1 Mean if ERR can not unarchive DELL /S *.GZ
I do not find the err but understand not work
FOR %%F in (D:\dnews\BAG\TEMP\*.gz) DO (C:\dnews\UTL\gzip -d "%%F") | (IF %ERRORLEVEL% EQU 1 DEL /S "%%F")
>> FOR %%F in (D:\dnews\BAG\TEMP\*.gz) DO (C:\dnews\UTL\gzip -d "%%F") = take each *.GZ file un-archive them
if get a ERR Run this (IF %ERRORLEVEL% EQU 1 DEL /S "%%F")
The >%ERRORLEVEL% EQU 1 Mean if ERR can not unarchive DELL /S *.GZ
I do not find the err but understand not work