Solved

Script to use Winzip to Package Daily Log Files

Posted on 2009-07-15
9
462 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 116
Adjust the position 3 65
TT Auto Dashboard 13 95
MS Access 03, TransferText, decimal places 8 78
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

828 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