Overwrite file automatically when unzipping

I have a customer that FTP's down a file from our server.  This is a zip file.  They then unzip the file and overwrite the old copy.  They perform this daily.  What I need is the ability to unzip the file without prompting to overwrite.  I am currently using pkzip command line to zip the file, but can change if necessary.

Thanks
Michael
LVL 3
SewellMAsked:
Who is Participating?
 
mesachConnect With a Mentor Commented:
I just looked at Winzip's "make .exe" function, and it has a check box for overwrite by default

to do it in CLI

wzunzip -o file.zip C:\path\to\where\you\want\to\unzip

will OVERWRITE the files in that path, however you mentioned that"the customer may load the file anywhere they like so a specific path is out of the question" How were you planning on accomplishing this through cli for them, if you make a batch file you will need to edit it every time they want to change the location.

I dont think I am grasping the whole concept of what you are looking for, unless you are looking to create an .exe through command line then you would need the Winzip Self Extractor program, the CLI commands for that are

wzipse32 filename.zip -overwrite -y

Don't use -o that is overlook not overwrite I didnt test that but it should work
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
If you're overwriting the files, why not just have a script that first deletes them.  Thus no overwrite and no prompt.
0
 
mesachCommented:
I use WinRar for compression and find that it gets better compression, you can save it as a zip file if you need to(i dont know the command line for that but here is one possible answer to your question

to overwrite the command you would use is

rar e -o+ document.zip c:\path\where\you\want

the -o+ signifys the over write command
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
mesachCommented:
After having just test it Winzip with the CLI works also but if you do not have the full(purchased) version it pops up a disclaimer that makes you hit any key to continue

the Syntax is

wzunzip -o file.zip C:\path\to\where\you\want\to\unzip

pkzip isnt giving out any free test versions of the pkzip for dos any more or i would test that.
0
 
SewellMAuthor Commented:
OK, I need to be clearer.  I create the recordlist.txt file using SQL DTS and copy the file to a seperate server.  The recordlist.txt file is then zipped up using PKZIP to create a self executing executable (via a batch file), and the zip file is loaded to the ftp server.  All of this works fine and is in my control.
The customer then downloads the file to their machine.  They then double click (from windows) on the self executing zip file.  ** Important part here **  When the zip file attempts to extract the recordlist.txt file, it finds an existing copy of recordlist.txt.  It then displays an alert about overwriting the file and the customer has to select yes. (This is what the customers want removed.  They want to double click and have the .txt file copied to the current folder without any more interaction. )
Customers may load the file anywhere they like, so a specific path is out of the question.  
I have no control over the method of extraction, so I use a self extracting zip.
I have tried most of the switches for pkzip when creating the file and have no luck.  I have looked into winzip and could use it if it accomplishes my needs.  I just need to extract the file without any user interaction beyond double clicking the SEP.

Michael
0
 
summerson83Commented:
With PKZIP, you can tell to with the '-o' option, but I'm not sure if you can force this option when creating the archive file. That's what you will have to use a self extracting file for users.

Anyway, you can do it with Windows version of Winzip if you would mind use this software (it's not free).
You can take a look here http://www.gail-wilson.com/winzip.htm, and you will find that you have to check an option "overwrite by default" when creating the self extracting file.
The only issue is whether the Winzip CLI (Command Line Interface) will let you do it in batch mode or not ?
0
 
mesachCommented:
wow i split my thoughts up disreguard the

"to do it in CLI

wzunzip -o file.zip C:\path\to\where\you\want\to\unzip"

part i was thinking half thoughts
0
 
SewellMAuthor Commented:
Got it to work, it just took 2 steps.  Used winzip.  Created the zip (from a batch file).  Created the self extracting executable from the command line add-on using the zip file.
wzipse32 zipfile -d . -auto -y -overwrite
The . signifies to unzip into the current directory.
0
 
SewellMAuthor Commented:
Thanks for the help mesach, you pointed me in the direction to get this issue resolved.

Michael
0
All Courses

From novice to tech pro — start learning today.