Go Back   Forums > Community Chatterbox > Tech Corner
Memberlist Forum Rules Search Today's Posts Mark Forums Read
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 13-09-2007, 07:44 PM   #1
Cold
Forum hobbit

 
Join Date: Aug 2007
Location: Regione Autonoma Siciliana, Italy
Posts: 48
Unhappy

Hi everybody, how is it? I need help about a program


I have a folder with some .Zip files, a lot of these are damaged so I need a program who automatically check CRC of every .zip file in this folder and then automatically deleted the CRC damaged files. Winzip doesn't make that kind of work, WinRar can only tell about damaged files but not help to delete it.

Please may someone help me to find a utility to make it right?
Cold is offline                         Send a private message to Cold
Reply With Quote
Old 13-09-2007, 08:02 PM   #2
dosraider
Dismembered.
 
dosraider's Avatar

 
Join Date: Aug 2007
Location: Dixmuide, Belgium
Posts: 2,767
Default

Thought 7Zip could do that.
http://www.7-zip.org/

Not 100% sure about the 'delete auto', never had to deal with that specific situation.
But at least in 7Zip you can select all the zipfiles in a folder to check them in one action.
__________________

Not a member of The Victorious People's Shoutbox Liberation Army.
Not a member of the GAG Guerrilla. Don't get A Grip!
FOR RENT
*Advertising space*
dosraider is offline                         Send a private message to dosraider
Reply With Quote
Old 13-09-2007, 11:41 PM   #3
Cold
Forum hobbit

 
Join Date: Aug 2007
Location: Regione Autonoma Siciliana, Italy
Posts: 48
Default

<div class='quotetop'>QUOTE(dosraider @ Sep 13 2007, 09:02 PM) [snapback]310709[/snapback]</div>
Quote:
Thought 7Zip could do that.
http://www.7-zip.org/

Not 100% sure about the 'delete auto', never had to deal with that specific situation.
But at least in 7Zip you can select all the zipfiles in a folder to check them in one action.
[/b]

It verify all the files but doesn't allow to delete damaged zip

I would like not to delete it by myself
Cold is offline                         Send a private message to Cold
Reply With Quote
Old 14-09-2007, 03:26 AM   #4
Scatty
Treasure hunter
 
Scatty's Avatar

 
Join Date: Jan 2006
Location: Little big small world
Posts: 1,906
Default

Why don't you like to delete the damaged ZIP's yourself?
Once the check is through, you would know which ones are damaged and all you have to do is to go to that folder and get rid of them... unless you're too lazy to be bothered.
Scatty is offline                         Send a private message to Scatty
Reply With Quote
Old 14-09-2007, 06:06 AM   #5
dosraider
Dismembered.
 
dosraider's Avatar

 
Join Date: Aug 2007
Location: Dixmuide, Belgium
Posts: 2,767
Default

Probably his downloaded pron pics, must be hundredthousands files.... :bleh:
__________________

Not a member of The Victorious People's Shoutbox Liberation Army.
Not a member of the GAG Guerrilla. Don't get A Grip!
FOR RENT
*Advertising space*
dosraider is offline                         Send a private message to dosraider
Reply With Quote
Old 14-09-2007, 11:39 AM   #6
Data
retired
 
Data's Avatar


 
Join Date: Jun 2004
Location: Jan Mayen, Svalbard and Jan Mayen
Posts: 2,167
Default

write a script that tests in the error level/return code of testing the zip file

Problem solved
__________________
Flowing with the stream of life
Data is offline                         Send a private message to Data
Reply With Quote
Old 14-09-2007, 12:43 PM   #7
So9
Forum hobbit

 
Join Date: Feb 2006
Location: Anirnar, Faroe Islands
Posts: 42
Default

hi Alex Cold

in addition to data's hint
here's the script i use. runs only on win2k/xp (vista ?)

Code:
@ECHO OFF
REM Path to Commandlineversion
REM download 7za from http://downloads.sourceforge.net/sevenzip/7za442.zip
SET MYZIP="%ProgramFiles%\7zip\7za.exe"
SET MYLOG=logfile_.txt
ECHO. > %MYLOG%

REM Check for ZipExe
IF NOT EXIST %MYZIP% GOTO :NOEXE

REM ask User for basepath or use current
ECHO enter directory to scan [return for %CD%]
SET /P MYROOT=
IF (%1) EQU () SET MYROOT="%CD%"

FOR /R %MYROOT% %%f IN (*.zip) DO CALL :SCANIT "%%f"

GOTO :EOF

:SCANIT
ECHO Scanning %1
@CALL %MYZIP% t %1 > USELESS.$$$
SET /A ERROR=%ERRORLEVEL%

REM Log and Remove all
IF %ERROR% EQU 0 ECHO %1 OK >> %MYLOG%
IF %ERROR% NEQ 0 ECHO %1 CORRUPT >> %MYLOG%
IF %ERROR% NEQ 0 CALL :REMOVEIT %1

@DEL USELESS.$$$

GOTO :EOF

REM Uncomment DEL to remove corrupt files
:REMOVEIT
ECHO REMOVING %1
REM DEL %1
GOTO :EOF

:NOEXE
ECHO No ZipProgram found
GOTO :EOF
__________________

So9 is offline                         Send a private message to So9
Reply With Quote
Old 14-09-2007, 02:27 PM   #8
Cold
Forum hobbit

 
Join Date: Aug 2007
Location: Regione Autonoma Siciliana, Italy
Posts: 48
Default

<div class='quotetop'>QUOTE(So9 @ Sep 14 2007, 01:43 PM) [snapback]310893[/snapback]</div>
Quote:
hi Alex Cold

in addition to data's hint
here's the script i use. runs only on win2k/xp (vista ?)

Code:
@ECHO OFF
REM Path to Commandlineversion
REM download 7za from http://downloads.sourceforge.net/sevenzip/7za442.zip
SET MYZIP="%ProgramFiles%\7zip\7za.exe"
SET MYLOG=logfile_.txt
ECHO. > %MYLOG%

REM Check for ZipExe
IF NOT EXIST %MYZIP% GOTO :NOEXE

REM ask User for basepath or use current
ECHO enter directory to scan [return for %CD%]
SET /P MYROOT=
IF (%1) EQU () SET MYROOT="%CD%"

FOR /R %MYROOT% %%f IN (*.zip) DO CALL :SCANIT "%%f"

GOTO :EOF

:SCANIT
ECHO Scanning %1
@CALL %MYZIP% t %1 > USELESS.$$$
SET /A ERROR=%ERRORLEVEL%

REM Log and Remove all
IF %ERROR% EQU 0 ECHO %1 OK >> %MYLOG%
IF %ERROR% NEQ 0 ECHO %1 CORRUPT >> %MYLOG%
IF %ERROR% NEQ 0 CALL :REMOVEIT %1

@DEL USELESS.$$$

GOTO :EOF

REM Uncomment DEL to remove corrupt files
:REMOVEIT
ECHO REMOVING %1
REM DEL %1
GOTO :EOF

:NOEXE
ECHO No ZipProgram found
GOTO :EOF
[/b]


Done. Thank you :brain:
Cold is offline                         Send a private message to Cold
Reply With Quote
Old 18-09-2007, 04:55 PM   #9
So9
Forum hobbit

 
Join Date: Feb 2006
Location: Anirnar, Faroe Islands
Posts: 42
Default

this is an optimized version of the script with zip and rar support

Code:
@ECHO OFF
REM Init LogFile
SET MYLOG=logfile_%DATE:~-10%.txt
ECHO. > %MYLOG%

CALL :ADDLOG "--------------------------------------------------------------"
CALL :ADDLOG "Archive-Check 0.1**************************************"
CALL :ADDLOG "--------------------------------------------------------------"

REM Path to Commandlineversion
REM download 7za from http://downloads.sourceforge.net/sevenzip/7za442.zip
SET MYZIP="%ProgramFiles%\7-zip\7za.exe"
SET MYRAR="%ProgramFiles%\batchfiles\rar.exe"

REM Check for ZipExe
IF NOT EXIST %MYZIP% GOTO :NOEXE %MYZIP%
IF NOT EXIST %MYRAR% GOTO :NOEXE %MYRAR%

REM ask User for basepath or use current
ECHO enter directory to scan [return for %CD%]
SET MYROOT=
SET /P MYROOT=
IF (%MYROOT%) EQU () SET MYROOT="%CD%"

REM Ask for Scanmode (Fast=Open and List Contents/Deep=CRC)
ECHO Scanmode (F)ast or (D)eep [Deep]
SET /P SCANMODE=
IF /I (%SCANMODE%) EQU (f) (SET SCANMODE=Fast) ELSE (SET SCANMODE=Deep)

REM Set ScanSwitches
IF /I (%SCANMODE%) EQU (Deep) (
SET SWZIP=t
SET SWRAR=t
) ELSE (
SET SWZIP=l
SET SWRAR=l
)

REM Add Command-Switch
SET MYZIP=%MYZIP% %SWZIP%
SET MYRAR=%MYRAR% %SWRAR%

REM Here we go
CALL :ADDLOG "--------------------------------------------------------------"
CALL :ADDLOG "RootDir : %MYROOT%"
CALL :ADDLOG "Mode****: %SCANMODE%"
CALL :ADDLOG "RAREXE**: %MYRAR%"
CALL :ADDLOG "ZIPEXE**: %MYZIP%"
CALL :ADDLOG "--------------------------------------------------------------"
CALL :ADDLOG "Started : %TIME% / %DATE%"

REM SCAN ALL ZIP FILES
FOR /R %MYROOT% %%f IN (*.rar) DO CALL :SCANRAR "%%f"
FOR /R %MYROOT% %%f IN (*.zip) DO CALL :SCANZIP "%%f"

CALL :ADDLOG "Stopped : %TIME% / %DATE%"
IF EXIST USELESS.$$$ DEL USELESS.$$$
GOTO :EOF

REM ####################################################################
REM # Scan Archives
REM ####################################################################

:SCANZIP
@CALL %MYZIP% %1 > USELESS.$$$
SET /A ERROR=%ERRORLEVEL%

REM Log and Remove
IF %ERROR% EQU 0 CALL :ADDLOG "%1 OK"
IF %ERROR% NEQ 0 CALL :REMOVEIT %1
GOTO :EOF

:SCANRAR
@CALL %MYRAR% %1 > USELESS.$$$
SET /A ERROR=%ERRORLEVEL%

REM Log and Remove
IF %ERROR% EQU 0 CALL :ADDLOG "%1 OK"
IF %ERROR% NEQ 0 CALL :REMOVEIT %1
GOTO :EOF

REM ####################################################################
REM #Subfunktions
REM ####################################################################

:REMOVEIT
REM Uncomment DEL to remove corrupt files
CALL :ADDLOG "%1 CORRUPT"
REM DEL %1
GOTO :EOF

:NOEXE
ECHO %1 not found
GOTO :EOF

:ADDLOG
SET LOGOUT=%1
SET LOGOUT=%LOGOUT:"=%
ECHO %LOGOUT%
ECHO %LOGOUT% >> %MYLOG%
GOTO :EOF
__________________

So9 is offline                         Send a private message to So9
Reply With Quote
Old 19-09-2007, 10:30 AM   #10
Morrin
Underground
 
Morrin's Avatar

 
Join Date: Oct 2004
Location: Iisalmi, Finland
Posts: 416
Default

Where do I put this script?
Morrin is offline                         Send a private message to Morrin
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
.ISO file sgtboat Troubleshooting 3 15-10-2008 11:15 AM
Need Help With Jar File Ioncannon Programming 4 22-03-2007 06:25 AM
Where Is The Exe. File. oyjah Troubleshooting 2 18-06-2006 11:54 PM
Bin But No Cue File? Guest_matt Troubleshooting 8 09-08-2005 09:05 PM
Pif File Guest Troubleshooting 8 28-04-2005 10:08 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 08:28 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.