开发者

How to get to desktop of any user by text file?

I have ini f开发者_开发知识库ile that I read in my program.

The ini file need to contain the desktop of any user.

How to write this?

%user%/windows?


If I understand your question correctly, try

%userprofile%\desktop


Try this code to get, in all cases, the actual desktop path :

for /f "tokens=3" %i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop"') do @set desktop=%i
echo %desktop%

Actually, the desktop path can be changed. The value is stored under HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Desktop.

Do not forget to double % if you run this in a batch file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜