本帖最后由 77七 于 2023-7-25 16:30 编辑
回复 5# q9339
- @echo off
- set "desk_rq_ex=REG QUERY "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop""
- for /F "tokens=2,*" %%d in ('%desk_rq_ex%') do call set desk_path_ex=%%e
- echo desk_path_ex=%desk_path_ex%
- cd /d %desk_path_ex%
- echo %cd%
- pause
复制代码
这里有个变量嵌套问题 |