19

I am trying to write a batch script to extract files out of an existing ZIP file, into another folder on my desktop and to have the system not prompt me as to whether I want to overwrite the existing files or not. The script works with just -o, but once I add -aoa, I get an error:

"C:\Program Files\7-zip\7z.exe" e file1.zip "-aoaC:\Documents and Settings\All Users\Desktop\all_backup_files"
Larry
  • 213
  • 1
  • 2
  • 6

2 Answers2

25

The 7-Zip command line options you will need are x, -o and -y:

"C:\Program Files\7-zip\7z.exe" x file1.zip -o"C:\Documents and Settings\All Users\Desktop\all_backup_files" -y

Note there mustn't be a gap between -o and the folder name.

If you type 7z --help you will get a list of valid parameters.

SeanC
  • 3,804
4
"C:\Program Files\7-zip\7z.exe" e file1.zip " -aoa -o"C:\Documents and Settings\All Users\Desktop\all_backup_files"

Note there mustn't be a gap between -o and the folder name.

this will solve the problem refer https://sevenzip.osdn.jp/chm/cmdline/switches/overwrite.htm