Jump to content
Sign in to follow this  
Achilles

Automating a built-in windows function

Recommended Posts

Achilles

Locate your @DesktopDir in a explorer windows. Right click >> Properties >> Tab:Location >> Here is where you can change your desktop to display any folder you want. When you click "Apply" or "Ok" it changes two registry locations (and two other backup ones that don't matter as much). These are stored at:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

If you shutdown explorer.exe and change these two values, it will work. However, I was hoping there was a method that didn't involve restarting explorer.exe.

Edit: Here's how I'm doing it with restarting explorer.exe

$path = 'C:\'
ConsoleWrite('-> _SetDesktopDir(' & $path & ')' & @CRLF)
ProcessClose('explorer.exe')
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'Desktop', 'REG_SZ', $path)
If StringInStr($path, @UserProfileDir) > 0 then $path = '%USERPROFILE%' & StringTrimLeft($path, StringLen(@UserProfileDir))
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders', 'Desktop', 'REG_EXPAND_SZ', $path)
Edited by Achilles

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×