在某吧有人问过,照搬代码:
1.- @ echo off
- set "reg=hkcu\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
- for /f "tokens=2*" %%a in ('reg query "%reg%" ^| findstr /i "\<desktop\>"') do (
- cd /d "%%b\"
- )
复制代码 2.- if exist "%USERPROFILE%\桌面\" (
- cd /d "%USERPROFILE%\桌面\"
- ) else cd /d "%USERPROFILE%\desktop\"
复制代码 3.- @ echo off
- %1mshta vbscript:createobject("wscript.shell").run("""%~0"" : """^&createobject("wscript.shell").specialfolders("desktop")^&chr(34))(close) & exit /b
- cd /d "%~2\"
- pause
复制代码
|