Solved

Script to use Winzip to Package Daily Log Files

Posted on 2009-07-15
9
437 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
Comment Utility
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
Comment Utility
It requires version 12.  We use version 9.
0
 
LVL 20

Expert Comment

by:hes
Comment Utility
0
 
LVL 10

Expert Comment

by:3_S
Comment Utility
http://www.winzip.com/wz90sr1.htm

command line for winzip version 9.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 4

Author Comment

by:Mark Walden
Comment Utility
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
Comment Utility
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
Comment Utility
I'll test it this afternoon and let you know.
0
 
LVL 4

Author Comment

by:Mark Walden
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
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.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

771 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

11 Experts available now in Live!

Get 1:1 Help Now