Solved

Script to use Winzip to Package Daily Log Files

Posted on 2009-07-15
9
447 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
  • 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
 
LVL 10

Expert Comment

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

command line for winzip version 9.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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.
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now