Solved

Script to use Winzip to Package Daily Log Files

Posted on 2009-07-15
9
471 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The viewer will learn how to implement Singleton Design Pattern in Java.
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.

628 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