batch files to automate "Compressed (Zipped) Folder" tasks

I am running Windows XP, and frequently use the feature "send to Compressed (Zipped) Folder" to move big files.

Is there a way to write batch files to automate compressing and extracting these files?

Who is Participating?
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.

Not "those" can use a vbscript to do that.
For a pure batch file, you'd need to grab the command-line versions of pkzip, and pkunzip...
I really like the command-line version of PowerArchiver (PACL), which can be found at
It comes with a small manual to help you understand all the different commands and parameters, the exit codes (for batch file errorlevel codes) and some examples.

I hope this helps.
hpsuserAuthor Commented:
So it sounds like I'd have to use a different tool then what we're currently using?
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Unless you want to script the process (send to compressed folder) using vbscript...I have some sample code, if you're interested...
hpsuserAuthor Commented:
I've never used vbscript, though if it's easy to implement and all I'd need to do is change the directories or files names I can give it a try...Thanks
This is what I'm using...this will recursively compress the .log files in the strPath folder...there may be some 'bugs' (which will error), since I typed this over (couldn't get my mail working at the office...)

Dim objFSO:Set objFSO=CreateObject("Scripting.FileSystemObject")


Set objFSO=Nothing

Sub ScanDirectory(objFolder)
  ScanFiles objFolder
  For Each fld in objFolder.Subfolders
    ScanDirectory fld
End Sub

Sub ScanFiles(objFolder)
  For each file in objFolder.Files
End Sub

Sub Compress(fil)
  If Lcase(strExt)="log" Then
    strZip=strPath & Replace(strFile,"log","zip")
    set zipFil=objFSO.CreateTextFile(strZip)
    zipFil.WriteLine chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18,0)
    Set oApp=CreateObject("Shell.Application")
    oApp.NameSpace(strZip).CopyHere strPath & strFile
    wscript.sleep 7000 'wait for file to be compressed
    Set oApp=Nothing
    Set zipFil=Nothing
    If objFSO.FileExists(strZip) Then objFSO.DeleteFile (fil) 'deletes file if the zip was created
  End If
End Sub

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
hpsuserAuthor Commented:
thanks, we've just launched the system that this will involve, when I get a chance I'll come back to this to implement.
hpsuserAuthor Commented:
SirBounty - I forgot about this one, finally got around to trying it and it worked, thanks for your help.
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
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.