General FYI:
Unzipping files via Powershell is very straightforward via the PS prompt:
Expand-Archive -Path
'C:\input.zip' -DestinationPath
'C:\output'
Reference:
https://www.shellhacks.com/windows-zip-unzip-command-line/
There are many other similar links.
Deleting files is done via Remove-Item.
As to a failed unzip I am not sure sure about handling that per se.
What you would need to do is to use Powershell and attempt to unzip a zipped file you already know is corrupted.
Note the error code(s).
However, it may be even easier than that via Try-Catch
Reference:
https://www.webservertalk.com/powershell-try-catch-tutorial-guide
Sort of putting it (the above references) together:
try
{
Expand-Archive -Path
'C:\input.zip' -DestinationPath
'C:\output'
}
catch
{
Remove-Item C:\input.zip
}
Write-Output "Unzip failed - Zip file removed"
Note: above script not tested. Just thinking out loud......
Plus the script would need to be inside some "loop" that parses through all of the target 3000 files.
Another consideration is that if any any given file does successfully unzip you may end up filling C:\output. Probably need to delete the contents of C:\output between unzip (Expand-Archive) attempts.
Overall appears straightforward to test and try.
Caveat: Just do so in a safe test environment wherein that if things go astray no real data will be lost.
I still have lots to learn about Powershell.