I have a batch file that runs each day and downloads about 20 .zip files from a network share to a server which then extracts them.. before continuing with other bits and bobs
the copying is carried out by ROBOCOPY, and the extraction done by 7zip
this was all working fine til yesterday when i realised my process was falling over every time. Turns out one of the .zip files was corrupt and when it tried to extract the batch file just bombs out
7zip has a file integrity check option but i cant for life of me figure out how to get the result of this check into something like an IF THEN ELSE execute the extract part
options i have considered:
1. only copy correct files with robocopy (cant work out how to check integrity, or even if its possible)
2. do a crc on the files - not really useful as i dont know what the results should be
3. use the 7zip t flag in some manner - 7z.exe t filename.zip and generate an ERRORLEVEL in the batch... bit lost on this one??????
5. batch file try-catch 'hack' - ok i was desperate at this point... :)
can anyone figure out a clever method of making this work? i will be eternally grateful because its starting to really **** me off... :p
perhaps i could run a check, output the successful results to a file and then only extract the filenames that are contained in that file??
If you go to the game developer website you can see that indeed Cyril Paciullo is the game director and developer https://www.pluralys.ca/about-us/ and when clicking on his name it lists Messenger Plus! as part of his CV. In case you wondered what happened to Patchou
A difficult position to be in. Either they cater to us users or they cater to news curators to potentially increase traffic. Personally, I wasn't being sarcastic. Hosting a website isn't free, so without traffic this site stops existing, and if you want traffic you have to play the game.
I legitimately thought the title was good. Not because I like it, but because it's the kind of title people will click on. This site needs that.
Question
BGM
Hi,
I have a batch file that runs each day and downloads about 20 .zip files from a network share to a server which then extracts them.. before continuing with other bits and bobs
the copying is carried out by ROBOCOPY, and the extraction done by 7zip
this was all working fine til yesterday when i realised my process was falling over every time. Turns out one of the .zip files was corrupt and when it tried to extract the batch file just bombs out
7zip has a file integrity check option but i cant for life of me figure out how to get the result of this check into something like an IF THEN ELSE execute the extract part
options i have considered:
1. only copy correct files with robocopy (cant work out how to check integrity, or even if its possible)
2. do a crc on the files - not really useful as i dont know what the results should be
3. use the 7zip t flag in some manner - 7z.exe t filename.zip and generate an ERRORLEVEL in the batch... bit lost on this one??????
5. batch file try-catch 'hack' - ok i was desperate at this point... :)
can anyone figure out a clever method of making this work? i will be eternally grateful because its starting to really **** me off... :p
perhaps i could run a check, output the successful results to a file and then only extract the filenames that are contained in that file??
thanks all
a frustrated chris :|
Link to comment
https://www.neowin.net/forum/topic/622510-7zip-in-a-batch-file/Share on other sites
5 answers to this question
Recommended Posts