@echo off
:: file: GetNiceTime.cmd
echo set hhmmsss
:: this is Regional settings dependant so tweak this according your current settings
for /f "tokens=1-3 delims=,: " %%a in ('echo %time%') do set hhmmsss=%%a%%b%%c
for /f "tokens=1-3 delims=,: " %%a in ('echo %time%') do set _hhmmsss=%%a:%%b:%%c
if /i %%a%%b%%c LSS 99999 SET hhmmsss=0%hhmmsss%
if /i %%a%%b%%c LSS 99999 SET _hhmmsss=0%_hhmmsss%
:: DEBUG PAUSE
ECHO hhmmsss IS %hhmmsss%
:: DEBUG PAUSE
:: echo yyyymmdd is %yyyymmdd%
:: this is Regional settings dependant so tweak this according your current settings
for /f "tokens=2-4 delims=. " %%D in ('echo %DATE%') do set yyyymmdd=%%F%%E%%D
for /f "tokens=2-4 delims=. " %%D in ('echo %DATE%') do set _yyyymmdd=%%F-%%E-%%D
::DEBUG
ECHO yyyymmdd IS %yyyymmdd%
:: DEBUG PAUSE
set NICETIME=%yyyymmdd%_%hhmmsss%
set _NICETIME=%_yyyymmdd% %_hhmmsss%
:: THIS NEEDS THE CLIP.EXE command line tool from the windows server 2003 resource kit
echo NICETIME IS %NICETIME%
echo %_NICETIME%| CLIP
:: DEBUG PAUSE
echo THE NICETIME IS %NICETIME%
echo THE _NICETIME IS %_NICETIME%
:: DEBUG PAUSE
:: REQUIREMENTS
:: ============================================================================
:: CLIP - google download windows resource kit
:: USAGE:
:: ============================================================================
:: PLACE IN YOUR PATH
:: Start - Run, type : GetNiceTime
:: Ctrl + V
:: eof file: GetNiceTime.cmd
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!