强大的批处理 (1) 字符串截取 语言 Add comments三 042009 获取当前的小时数:123456789@ECHO OFF SET Hour=%TIME:~0,2% IF %Hour% GTR 12 ( ECHO Afternoon ) ELSE ( ECHO Morning )打印Windows的版本:1234567891011121314@ECHO OFF FOR /F "tokens=1,2,3,4" %%I IN ('VER') DO ( SET Ver_Temp=%%L ) SET Ver_Major=%Ver_Temp:~0,1% SET Ver_Minor=%Ver_Temp:~2,1% SET Ver_Build=%Ver_Temp:~-5,4% ECHO Windows Version: ECHO Major %Ver_Major% ECHO Major %Ver_Minor% ECHO Build %Ver_Build%您还可能感兴趣的日志:强大的批处理 (4) 使用数组强大的批处理 (2) Fibonacci函数强大的批处理 (3) 判断目录在%Path%中 Leave a Reply Cancel reply Name (required) E-mail (required) URI Your CommentYou may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>