Here, try this. It should work. (At least it worked on my computer, running Windows XP SP2)
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
;
;
; Script Function:
; Change the location of the Default Desktop Folder through right-click menu on the systray icon.
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#Persistent
Regread, current, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop
GoSub,INIREAD
GoSub,TRAYMENU
INIREAD:
IfNotExist,%A_ScriptName%.ini
{
IniWrite,%current%,%A_ScriptName%.ini,Locations,dir1
IniWrite,Location 2,%A_ScriptName%.ini,Locations,dir2
IniWrite,Location 3,%A_ScriptName%.ini,Locations,dir3
IniWrite,Location 4,%A_ScriptName%.ini,Locations,dir4
}
IniRead,dir1,%A_ScriptName%.ini,Locations,dir1
IniRead,dir2,%A_ScriptName%.ini,Locations,dir2
IniRead,dir3,%A_ScriptName%.ini,Locations,dir3
IniRead,dir4,%A_ScriptName%.ini,Locations,dir4
Return
TRAYMENU:
Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,%current%,CURRENT
Menu,Tray,Add,
Menu,Tray,Add,"%dir1%",DIR1
Menu,Tray,Add,"%dir2%",DIR2
Menu,Tray,Add,"%dir3%",DIR3
Menu,Tray,Add,"%dir4%",DIR4
Menu,Tray,Add,
Menu,Tray,Add,Edit,EDIT
Menu,Tray,Add,Reload,RELOAD
Menu,Tray,Add,
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Tip,%A_ScriptName%
Menu,Tray,Check,%current%
Return
CURRENT:
DIR1:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir1%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Reload
Return
DIR2:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir2%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Reload
Return
DIR3:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir3%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Reload
Return
DIR4:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir4%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntÃ…, 0)
Reload
Return
EDIT:
Runwait,%A_ScriptName%.ini
Return
RELOAD:
Reload
EXIT:
ExitApp