Is it possible to create a self-extracting WinZip executable that overwrites read-only files?

Using WinZip Self-Extractor, I have created a self-extracting executable that I plan to distribute to people, so that they can update some files on their computers.  However, when I run the executable, I get the error: "Can't create output file: <filename>", and the extraction fails.  The problem is that some of the files that I'm trying to overwrite are read-only.  Is there anyway to configure the self-extractor to ignore the file permissions (even if it involves prompting the user)?

My workaround is to have them extract to a temp directory and then copy the files using windows explorer, but I would rather avoid this workaround if possible.

Thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Another possible workaround to exclude having users interact with the process is that you could include a batch file that would process your commands for you after extracting to the temp directory.  Such as create a folder in temp and extract the files there.  Then upon extraction, automatically execute the batch file that could either copy this directory of  your files and then they would be prompted to confirm the overwriting OR you could include in the batch file (if you know the directory they are going to be copied into) a few lines that will remove the read-only attribute of the whole directory or one file at a time (using the attrib command) and then reinstate it (also using attrib command).

If you are unsure how to do this batch, let me know and I'd be happy to help.  If you have any further questions, please write them here.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I think WINRAR can ignore the file attributes, but it is not a free program, however, it will make executables like winzip.  It is slower than winzip, but more options.  But if you want to distribute a batch file with the winzip EXE, here is your solution, using the attrib.exe file distributed with windows, you need 3 files, your updatedzip.exe, attrib.exe and update.bat, as follows -

Update.bat -

attrib -R -S -H C:\yourdirectory\*.*

- end update.bat.

Make sure the spaces are between the -R -S -H, else it not work at all.
do what matricii says, in winzip self extractor, u can specify what program to run after extraction
so users extract to temp directory, self extractor runs your file you specified automatically

this file of yours, will reset permissions as described by scratchyboy
then use something like xcopy to copy directories

Yup... that would be your best bet...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.