> Hi,
>
> In my cpda.bat file
> copy %1 %1.%date:~12,2%%date:~4,2%%date:~7,2%
>
> cpda work.brd
> gives me
> work.brd.060525
>
> How do I modify it for
> cpda work.brd
> to give me
> work.brd.060525-1620
> where 1620 represents 4:20pm
Use similar commands with the %time% variable.
-%time:0,2%%time:3,2%
Did you try parsing %time% already? After try parsing %time% you will notice
there is a space before hours less than 10. To assure hours less than 10 are
formatted with a leading zero, store %time% in a variable then replace space
with zero.
set dt=%date:~12,2%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%
set dt=%dt: =0%
copy %1 %1.%dt%
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
> Fri, 26 May 2006 13:22:34 GMT Todd Vargo <tlv...@sbcglobal.netz> wrote:
>| set dt=%date:~12,2%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%
>| set dt=%dt: =0%
>| copy %1 %1.%dt%
>
>
> From my new bat file
> copy %1 %1.%date:~12,2%%date:~4,2%%date:~7,2%-%time:0,2%%time:3,2%
Try the code above, that Todd posted.