|www.rodneybeede.com||"I would love to change the world, but they won't give me the source code" - unknown|
@REM Valid only for U.S. (English) locale
FOR /F "tokens=1-3 delims=:." %%i IN ('echo %time: =0%') DO SET HOUR=%%i& SET MINUTE=%%j& SET SECOND=%%k
Note that the %time% variable has the leading space (if any, exists when hour < 10) converted to a leading 0.
Again it only works for the U.S. locale (and similiar). If you need something that works regardless of locale there are other examples that do it in a batch script, but you should really consider an external .com or .exe that inserts it into your batch script (Google it) or use a Windows Scripting Host script instead.