Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a simple batch file to unzip & overwrite existing file [closed]

I'm trying to use a simple batch file to unzip and overwrite an existing file. Can anyone tell me the correct parameter to use to automatically overwrite without having to intervene please?

The unzip.bat batch file contains:

unzip "G:\Extracts\report.zip" "G:\Extracts\report\" 

This works fine except that it asks me to "Replace the file in the destination?"

like image 203
suzymuse Avatar asked Mar 29 '16 08:03

suzymuse


1 Answers

Unzip command has -o option, which forces file overwrite. Your batch file should look like this:

unzip -o "G:\Extracts\report.zip" -d "G:\Extracts\report\" 

Optionally, you can add -q for quiet mode.

like image 198
cakan Avatar answered Sep 18 '22 12:09

cakan