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!

Re: What's the best/easiest way to Rename a file using Date/Time Variables? by Steven

Steven
Tue May 25 14:20:36 CDT 2004

Another one.........

http://www.ericphelps.com/batch/

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


"Cumulous" <Cumulous128----NOSPAM----@yahoo.com> wrote in message
news:ehRbgzoQEHA.1440@TK2MSFTNGP10.phx.gbl...
>
> 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!
>
>
>



Re: What's the best/easiest way to Rename a file using Date/Time Variables? by Steven

Steven
Tue May 25 14:19:36 CDT 2004

http://www.cybertrails.com/~fys/index.htm

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


"Cumulous" <Cumulous128----NOSPAM----@yahoo.com> wrote in message
news:ehRbgzoQEHA.1440@TK2MSFTNGP10.phx.gbl...
>
> 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!
>
>
>



Re: What's the best/easiest way to Rename a file using Date/Time Variables? by Dr

Dr
Wed May 26 07:57:12 CDT 2004

JRS: In article <ehRbgzoQEHA.1440@TK2MSFTNGP10.phx.gbl>, seen in
news:microsoft.public.scripting.vbscript, Cumulous <Cumulous128----
NOSPAM----@yahoo.com> posted at Tue, 25 May 2004 15:17:04 :
>
> 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.

> 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"

2004-05-24 would be a better format; and, AIUI, is a FIPS.

>2. Rename that file also using the current Date/Timestamp however I choose.
> ...


That, ISTM, would better have been asked in a newsgroup on batch file
programming; alt.msdos.batch for DOS..Win98/ME and alt.msdos.batch.nt
for NT+. See via sig line 4 below.

For date & time, DOS ... NT+, see NOWMINUS via sig line 3 below.

For something on date & time in VBscript, see <URL:http://www.merlyn.dem
on.co.uk/vb-dates.htm>

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.