Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Change Explorer Favorites Location

Keywords: 	  explorer favorites

Question:

Below is some code that I took from the examples and modified to see if I could change the location that explorer saves its favorites. I am having trouble getting to the key to modifiy it. Ideally I would like to be able to look at it and see its value and if the value is wrong set it to the new value. Below is as far as I got. has got any code snipits that do this ?

This is the key that I got from regedit:

	HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
As a sub to this key there is the value “favorites” and the data that is the file location. This was my unsuccessful attempt to get the value:
	key=RegOpenkey(@REGCURRENT, "Software\Microsoft\Windows\CurrentVersion\Explorer\ShellFolders\favorites")
	who=RegQueryKeys(key)
	who=StrReplace(who,@tab,@crlf)
	RegClosekey(key)

Answer:

;Define key name
keyitem=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[favorites]"

;Look at item
where=RegQueryValue(@REGCURRENT,keyitem)
Message("Old Value",where)

newwhere="C:\TEMP"
RegSetValue(@REGCURRENT,keyitem,newwhere)
You may need to restart explorer ot maybe even reboot for this change to take effect.
Article ID:   W13133
Filename:   Change Explorer Favorites Location.txt