@echo off
setlocal enabledelayedexpansion
title %date% %time:~,8% by Kinve
::set CurTime=%date:~0,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%

set Y_M_D=%date:~2,2%%date:~5,2%%date:~8,2%
set M_D=%date:~5,2%%date:~8,2%
::0替换空格
set "T=%time: =0%"
set hours=%T:~0,2%
set min=%T:~3,2%
set sec=%T:~6,2%

set CurTime=%Y_M_D%%hours%%min%

echo !hours!:!min!
echo !CurTime!

(
  echo #ifndef __VERSION_H__
  echo #define __VERSION_H__
  echo,
  echo #define CUSTOM_VER		%CurTime%
  echo,
  echo #endif
  echo,
)>../../Code/User/version.h

::copy /y version.h ../version.h
::del version.h

::获取参数，采用%1~%9来获取每个参数的值
::==================10进制转16进制=============================
::使用call:dec2hex 18
::返回值在中%ret%
:dec2hex
rem set str=0123456789ABCDEF&set "ret="
::set/a d=%~1
:lp
rem set/a y=!d!%%16,d/=16
rem call set ret=%%str:~!y!,1%%!ret!
rem if !d! NEQ 0 goto:lp
rem goto :eof
::=======================END CODE===============================


