• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1625
  • Last Modified:

schedule file to unzip

I need to unzip a file every day and I was wondering whats the best way to schedule the file to unzip to a directroy and overwrite its old files every day at a certain time?
if say the zip file is C:\file storage\new.zip and I want to unzip that to C:\file storage\new\

I am guessing that I could use a batch file to do it and then but the batch file in scheduled tasks
but what needs to be in the batch file?
0
BTMExpert
Asked:
BTMExpert
  • 13
  • 8
  • 3
1 Solution
 
TheCleanerCommented:
Someone just answered this question, I can't remember who though...it was just last week.

Winzip pro will do it:

You can schedule a WinZip Job file to run any time you wish. Click Schedule on the Specifications Complete panel of the Job Wizard. This is WinZip Pro feature.

http://www.winzip.com/hints_and_tips.htm?cnda

my thought is you could use the command line syntax with winzip pro to do it for you.

Hopefully the person (I think it was leew) that answered it last time can swing by here.
0
 
TheCleanerCommented:
LOL, well I guess you were the one that asked the question:

http://www.experts-exchange.com/Operating_Systems/Windows_Server_2003/Q_21779364.html

Did it not take care of what you needed?
0
 
BTMExpertAuthor Commented:
nope I couldn't get it working
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
TheCleanerCommented:
You should ask in the community support section to reopen that one and close this one...especially since you don't have any points now.
0
 
cwwkieCommented:
You can try 7-zip (http://www.7-zip.org/). It has a commandline interface (7za.exe)
0
 
BTMExpertAuthor Commented:
I was able to get the infozip program working its the command line part of all of this that I don't understand


and how to automate the command line part of it
0
 
cwwkieCommented:
I don't know infozip, but I can explain it for 7-zip, asuming it is simular for infozip;

Create a batchfile with the following four lines:

@echo off
c:
cd "C:\file storage\new\"
"C:\Program Files\7-Zip\7za" x -y "C:\file storage\new.zip"

The x is to eXtract, the -y option is to answer yes to all questions (do you want to overwrite?)
Because 7za is not able to extract to another directory than the current directory, the current directory is first changed to the directory where the files must be stored.
0
 
TheCleanerCommented:
LOL I thought I posted the command line earlier today...oh well...I downloaded infozip and it should be:

unzip -Z -ddo "C:\file storage\new.zip" -d "C:\file storage\new\"

OR maybe

unzip -ddo "C:\file storage\new.zip" -d "C:\file storage\new\"

The options are confusing, Let us know...
0
 
TheCleanerCommented:
Ah...I posted it in the other question:

I went ahead and downloading Infozip to see the program.

The command line looks like it would be:

unzip -ddo "c:\file storage\new.zip" -d "c:\file storage\new"

or

unzip -Z -ddo "c:\file storage\new.zip" -d "c:\file storage\new"


You'll need to test it...

Then when it is right...put it in a notepad doc, and then Save As, unzipbatch.bat (make sure you change it to all files when saving it or it will end up as unzipbatch.bat.txt)

Then open task scheduler and set up a scheduled task to run that batch file.


NOTE:  the batch file and the unzip program needs to be in the same location.
0
 
cwwkieCommented:
> Ah...I posted it in the other question:

Yes, that is the disadvantage of having two questions. I did not subscribe to the other one, so I did not see it.
0
 
BTMExpertAuthor Commented:
ok I am in my cmd prompt I make sure I am in the C:\Program Files\Wiz directory where info zip said I should install it and I type in the what you suggested but I get the error 'unzip' is not recognized as an internal or external command, operable program or batch file.

I tried looking for the command line commands for it in the help section of info zip but couldn't find anything about command lines
0
 
TheCleanerCommented:
look in that directory for the unzip.exe file (or do a search for it).  That's where the command line should be typed out.

The help file I referred to is in the unzip.txt file
0
 
TheCleanerCommented:
Oh...btw...the whole "Wiz" directory thing...I didn't run an install.  Just downloaded the unz552xN.exe from their site, and ran the exe (inside a command prompt) and it extracted all of the files.  No need to install anything...
0
 
BTMExpertAuthor Commented:
I don't see a file called unzip.txt in that directory we are both talking about info zip 5.03 right?
0
 
TheCleanerCommented:
Here's what I did:

Go to info-zip.org

Then clicked on this link:

ftp://ftp.info-zip.org/pub/infozip/

There I clicked on Win32 directory and it got me here:

ftp://ftp.info-zip.org/pub/infozip/WIN32/

The readme says that the file needed is unz552xN.exe

so I downloaded that to a new folder and went to a command line in that folder and ran the .exe to extract it all.
0
 
BTMExpertAuthor Commented:
ok so I changed the
unzip -ddo "c:\file storage\new.zip" -d "c:\file storage\new"

to

wiz.exe -ddo "c:\file storage\new.zip" -d "c:\file storage\new"

and now its opening up the info zip program but I am getting a prompt that says "Can't open -ddo "c:\file storage\new.zip" -d "c:\file storage\new""
0
 
TheCleanerCommented:
Try the last post I put up...I think you have the GUI version going.
0
 
BTMExpertAuthor Commented:
I don't understand what you mean

I have the program installed and working properly
I am just trying to get it to unzip a file using the command line
0
 
TheCleanerCommented:
I think you got the wrong version.

Go through my steps above to download the command line version.  Then run the command.
0
 
BTMExpertAuthor Commented:
ok the command line is now working but it still isn't unzipping
so to simplify it I moved the files into the root of C: and was trying this


C:\Program Files\Wiz>unzip -ddo "c:\test.zip" -d "c:\testfiles\"
Archive:  c:/test.zip
caution: filename not matched:  -d
caution: filename not matched:  c:/testfiles/

C:\Program Files\Wiz>unzip -Z -ddo "c:\test.zip" -d "c:\testfiles\"
ZipInfo 2.42 of 28 February 2005, by Greg Roelofs and the Info-ZIP group.

List name, date/time, attribute, size, compression method, etc., about files
in list (excluding those in xlist) contained in the specified .zip archive(s).
"file[.zip]" may be a wildcard name containing *, ?, [] (e.g., "[a-j]*.zip").

   usage:  zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]
      or:  unzip -Z [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]

main listing-format options:             -s  short Unix "ls -l" format (def.)
  -1  filenames ONLY, one per line       -m  medium Unix "ls -l" format
  -2  just filenames but allow -h/-t/-z  -l  long Unix "ls -l" format
                                         -v  verbose, multi-page format
miscellaneous options:
  -h  print header line       -t  print totals for listed files or for all
  -z  print zipfile comment   -T  print file times in sortable decimal format
  -C  be case-insensitive     -M  page output through built-in "more"
  -x  exclude filenames that follow from listing


so I think its just the syntex error
0
 
TheCleanerCommented:
try the first one again as simply

unzip "C:\test.zip" -d "C:\Program Files\Wiz"

and see if it unzips to the Wiz folder...then we can go from tehre...
0
 
BTMExpertAuthor Commented:
ok that worked
is it that the folder has to be created to start with?

and how can I set it so it replaces them all without prompting
0
 
TheCleanerCommented:
go ahead and create the folder it's going to be extracted to.

then try the command as:

unzip -do "C:\test.zip" -d "C:\Program Files\Wiz"

the unzip.txt has the command line options, but good luck trying to figure it out...it's pretty cryptic.

the -do should do a silent overwrite.
0
 
TheCleanerCommented:
Thank you for the points!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 13
  • 8
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now