I was wandering if someone who is familiar with batch files could help me out? I have the following code to create a time stamp folder for some configuration files. This code runs on XP but errors out on the set hh command when ran on an NT platform.
What is happening is hh gets set to :~0,2. The time command is not getting interpreted correctly. When I execute the time command in the DOS prompt it does correctly display the time.
Any help greatly appreciated!!!
@echo off
set hh=%time:~0,2%
REM Since there is no leading zero for times before 10am, have to put in
REM a zero when this is run before 10am
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set yymmdd_hhmmss=config_%1_%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2%%.log
setmode %1 > .\stateLogs\%yymmdd_hhmmss%