Thanks for your timely response, but I have since figured it out and it works fine now.
I use it to RENAME an existing file uploaded from a bar code scanner to the required date time string for a vendor script to pick it up and process it. Below is the portion of the MS DOS batch regarding the renaming. Also works well for creating and naming a folder with a little tweaking. It is a pretty handy little function and I doubtlessly will find other uses for it. I am going back later to enter some REM lines for clarity.
set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set NewName=DATA-%date:~-4,4%%date:~-10,2%%date:~-7,2%-%HH%%time:~-8,2%%time:~-5,2%
ren dtfile1.txt %NewName%.txt
Thanks for your timely response, but I have since figured it out and it works fine now.
I use it to RENAME an existing file uploaded from a bar code scanner to the required date time string for a vendor script to pick it up and process it. Below is the portion of the MS DOS batch regarding the renaming. Also works well for creating and naming a folder with a little tweaking. It is a pretty handy little function and I doubtlessly will find other uses for it. I am going back later to enter some REM lines for clarity.
set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set NewName=DATA-%date:~-4,4%%date:~-10,2%%date:~-7,2%-%HH%%time:~-8,2%%time:~-5,2%
ren dtfile1.txt %NewName%.txt