Intelligent Archiving Batch Files - TechRepublic
General discussion
January 18, 2001 at 04:31 AM
anthropic al

Intelligent Archiving Batch Files

by anthropic al . Updated 25 years, 5 months ago

Does anyone know of a way of making a batch file that uses the copy command and its ability to rename the destination file but in such a way that it renames the file according to a rule?

In particular I want to archive Event Logs. Copy the file C:\Winnt\System\Appevent.evt to a folder X:\Archive\Evntlogs\ and rename the file AppXXXX.evt where XXXX is a number 1 greater than the previous AppXXXX.evt (so the first Archive renames it App0001.evt, the next renames the new Appevent.evt to App0002.evt etc.).

This way I could run it as a Schedule and have a complete record of all events on the Server without having huge Event log files.

This discussion is locked

All Comments