×

bat读取桌面路径 如何用bat读取桌面路径如何把它读出来 然后把 路径 赋值给 a比如路径改为了 D:\桌面让 a=D:\桌面 这样

hqy hqy 发表于2022-08-17 08:15:46 浏览871 评论0

抢沙发发表评论

mportant; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; margin: 0px !important; padding: 0px 1em !important;">@echo off
for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Desktop"'do Set a=%%j
echo 你当前桌面路径是:%a%
pause
rem 下面是修改桌面路径
set "a=D:\桌面"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Desktop" /t REG_SZ /d %a%
pause


如果是XP
set d=%USERPROFILE%\桌面
如果是W7
set d=%USERPROFILE%\desktop

即可


打赏

本文链接:https://www.kinber.cn/post/2655.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客