1,日期和时间
echo %date:~0,4%年%date:~5,2%月%date:~8,2%日 %time:~0,8%
2,获取桌面地址
for /f "tokens=2,*" %%i in ('reg query "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v "Desktop"') do (
set desk=%%j
)
将桌面地址赋值给desk,如果下面要调用的话,直接调用%desk%