I've been hashing away at this for a while now. I need to search a directory every hour for a filename and if it exists, zip it while keeping the existing filename intact minus the file extension. Then another script that I didn't write will grab it and ship it somewhere else.
For instance:
dir *.evt if (*.evt) exists [compress] (somehow, into .zip format) delete *.evt
What I've done: The MS compress tool does a good job and it keeps the filename but I can't control the output.
For instance, if I run "compress fishtank-*.txt -Z -R" on filename "fishtank-2006-12-01-13-01-54-847.txt"it will compress the file in "mszip" format to fishtank-2006-12-01-13-01-54-847.tx_ but I can't rename it to a *.zip or winzip will fail to read it.
Right now I need to find something that will scan a directory (in this case c:\windows\system\config\) for the file, and compress it in the right format.
I think you can run scripts in winrar, and have it output a .zip file. Don't quote me on that though, as I'm at work and don't have my WinRAR on this computer.
7zip = freeware . . and although I've never used them, I know there are command line extensions for it that should be able to do what I think you want to accomplish here
[edit]
my bad, it's not command line extensions . . . it's a command line version
It already has the time/date/random number stamp. Just take the existing 100mb text file ending in ".evt" in the %windir%\System\ (Running Citrix with remapped drives so we have to use this instead of an exact path), zip it to *.zip using the existing filename, then delete the original ".evt" file.
Why can't you move/rename the file at compression time? The script compressing the file should already have the generated filename, which should also be able to move the file to wherever you need it.