• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 486
  • Last Modified:

Script to use Winzip to Package Daily Log Files

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
Mark Walden
Asked:
Mark Walden
  • 4
  • 3
1 Solution
 
3_SCommented:
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
 
Mark WaldenInformation Security EngineerAuthor Commented:
It requires version 12.  We use version 9.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
3_SCommented:
http://www.winzip.com/wz90sr1.htm

command line for winzip version 9.
0
 
Mark WaldenInformation Security EngineerAuthor Commented:
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
 
3_SCommented:
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
 
Mark WaldenInformation Security EngineerAuthor Commented:
I'll test it this afternoon and let you know.
0
 
Mark WaldenInformation Security EngineerAuthor Commented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now