Batch File Self Extracting Zip

Tag: batch-file , 7zip Author: needsomehelp Date: 2014-04-01

I am using 7zip to create a self extracting zip file. When I run the .exe it extracts things into the directory where the .exe was fired off like I want. But is there a way to always overwrite instead of seeing the prompt screen asking you?

I did read that -aoa or-y may be my answer, but I could not get them to work.

@echo off
set PATH=%PATH%;Y:\Program Files\7-Zip\

set branchPath=Z:\XP_Processes\branch\%1\
set dwcltrn=DWCLTRN.DBF
set dwemptrn=DWEMPTRN.DBF
set dwhist=DWHIST.DBF

echo %branchPath%

cd /d %branchPath%

7z a -sfx "Z:\XP_Processes\%1.exe" %dwcltrn%
7z a -sfx "Z:\XP_Processes\%1.exe" %dwemptrn%
7z a -sfx "Z:\XP_Processes\%1.exe" %dwhist%

Other Answer1

Type in Start - All Programs - Accessories - Run

iexpress 

Follow prompts to add your files.

Run the program you just made

"C:\Users\Fred\test.EXE" /Q /T:c:\users

Other Answer2

Try launching your SFX file like so: myfile.exe -y