326- @echo off
- setlocal enableDelayedExpansion
- set x=%systemroot:~-7%
- for /l %%i in (0 1 6) do (
- if /i "!x:~%%i,1!"=="D" set d=%%i
- if /i "!x:~%%i,1!"=="S" set s=%%i
- if /i "!x:~%%i,1!"=="N" set n=%%i
- set "!d!=!d!!n!!s!" 2>nul
- )
-
- ECHO "!%d:~,1%!"
复制代码 偷懒了 |