Solved

Script to use Winzip to Package Daily Log Files

Posted on 2009-07-15
9
466 Views
Last Modified: 2012-08-13
I'm current running a VB script to archive and clear the Event Log on each of my servers.  I must use Winzip because of licensing.   I would like to use VB so i can tack it on to the end of my current archive script, rather than running a second .bat of .cmd file.  

Event logs are saved to a specific folder as:
ServerName_App_Date.evt
ServerName_Sec_Date.evt
ServerName_Sys_Date.evt
etc...

What could i add to the end of the script to Package these file into a single Zip file as ServerName_Date.zip
0
Comment
Question by:Mark Walden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 10

Expert Comment

by:3_S
ID: 24861533
dowload the WinZip Command Line Support Add-On from the winzip website.
Then you can make a zip file using the command line using a shell in VB
0
 
LVL 4

Author Comment

by:Mark Walden
ID: 24861827
It requires version 12.  We use version 9.
0
 
LVL 20

Expert Comment

by:hes
ID: 24862716
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!

 
LVL 10

Expert Comment

by:3_S
ID: 24862817
http://www.winzip.com/wz90sr1.htm

command line for winzip version 9.
0
 
LVL 4

Author Comment

by:Mark Walden
ID: 24863629
OK 3_S, now what.  I can zip the files and give it a name (MyZip.zip).  However, this will be a daily task so i need the file name to be ServerName_Date.zip.  Any ideas?
0
 
LVL 10

Accepted Solution

by:
3_S earned 350 total points
ID: 24864454
You could take the zipfile name from your .evt -file. use a replace to make the .evt to .zip
dim fileName
fileName = "ServerName_Sys_Date.evt"
fileName = Replace(fileName ,"_Sys","")
fileName = Replace(fileName ,".evt",".zip")
Dim wshShell
Dim WinZipCommand
WinZipCommand = "Your winzip command" 'Add you winzip command and use variable fileName to define the output winzipfilename
Set wshShell = CreateObject("WScript.Shell")
wshShell.Run(WinZipCommand)

Open in new window

0
 
LVL 4

Author Comment

by:Mark Walden
ID: 24868658
I'll test it this afternoon and let you know.
0
 
LVL 4

Author Comment

by:Mark Walden
ID: 25113518
I have still not made this work yet.   I have been placed on a new project so i have move this to the bottom of the list for now.  
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question