I have a ridiculously simply need. I have a Batch file which performs
certain Archiving functions for me. At the end, it Zips everything up into
one file.
However, the functionality I need is to be able to, at the time of
execution, create a new Folder and rename a file(s) using Date and/or Time
variables.
For example, if I'm running my "Archive.bat" file on 5/25/2004 at
2:46pm, when I'm done I'll end up with a file called "Archive.zip"
I need to have a Script that will do the following:
1. Create a Folder using the current Date/Timestamp however I choose.
For example, if I specify (either in the Script or via command line
parameter) "Archive Folder - MM-DD-YYYY", I want to end up with a folder
named "Archive Folder - 05-25-2004"
2. Rename that file also using the current Date/Timestamp however I choose.
For example, if I specify (also either in the Script itself, or via
command line parameter) - "Archive - MM-DD-YYYY - HH:MM:AP.zip", I want to
end up with a file named "Archive - 05-25-2004 - 2:46pm.zip"
The format of the date and time doesn't have to be that dynamic for the
actual naming of the file/folder. I'm perfectly fine defining the format
within a variable (Say, for example, "CurrentDate" and "CurrentTime") and
then using those variables for the naming (i.e. "Archive - %CurrentDate -
%CurrentTime.zip" )
What is the best way to achieve this goal? I can't imagine it's that
difficult, but I'm not terribly familiar with script programming. I'd
appreciate whatever help anyone could offer.
Thanks!