@echo off
echo 当前盘符:%~d0
echo 当前登陆用户:%username%
echo 当前盘符和路径:%~dp0
echo 当前盘符和路径的短文件名格式:%~sdp0
echo 当前批处理全路径:%~f0
echo 当前CMD默认目录:%cd%
echo 电脑名: %computername%
pause
@echo off
set id=%USERNAME%
echo %id%
pause
@echo off
set n=%computername%
set Nname=%n:~3,-3%
echo %Nname%
pause