PDA

View Full Version : Add Custom Folder to My Computer or the Desktop (revised) (W2K)



dinwath
08-09-2003, 05:59 AM
hi folks!
this is not a really new twaek, in fact is known since a couple of years, but in the guide here in this site something is missing....
If you are a Windows 2k domain administrator and want your users to have a special folder on their desktop linked to a share on your server AND you want to set it only when users log in AND you don't want to give them registry access over important keys such as LOCAL_MACHINE or CLASSES_ROOT
you can do this way:
Follow the tutorial at http://www.winguides.com/registry/display.php/73/ (http://www.winguides.com/registry/display.php/73/)
but replace <font color=red>HKEY_CLASSES_ROOT\CLSID\</font color=red>
with <font color=green>HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\</font color=green> and also replace <font color=red>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Explorer\SpecialFolderName\NameSpace\</font color=red> with <font color=green>HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\SpecialFolderName\NameSpace\</font color=green>
where SpecialFolderName can be:
Desktop
MyComputer
ControlPanel
NetworkNeighborhood
NetworkNeighborhood\EntireNetwork
RemoteComputer.

( also see <a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/namespaceextension/nse_junction.asp>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/namespaceextension/nse_junction.asp</a>)

In this way you can set up for every user within the domain policy a login script that creates these registry keys and a logout script that deletes them.
I hope that someone finds this tip useful....
see ya!

Ps. here is the script file that I use to do the work
/*
var shell=WScript.CreateObject('WScript.Shell')
shell.RegWrite('HKCU\\SOFTWARE\\Classes\\CLSID\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\','My Shared Documents','REG_SZ');
shell.RegWrite('HKCU\\SOFTWARE\\Classes\\CLSID\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\InfoTip','Stores and manages documents on server','REG_SZ');
shell.RegWrite('HKCU\\SOFTWARE\\Classes\\CLSID\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\DefaultIcon\\','%systemroot%\\syste m32\\mydocs.dll','REG_EXPAND_SZ');
shell.RegWrite('HKCU\\SOFTWARE\\Classes\\CLSID\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\InProcServer32\\','shell32.dll','RE G_SZ');
shell.RegWrite('HKCU\\SOFTWARE\\Classes\\CLSID\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\InProcServer32\\ThreadingModel','Ap artment','REG_SZ');
shell.RegWrite('HKCU\\SOFTWARE\\Classes\\CLSID\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\Shell\\Open My shared Documents\\Command\\','explorer.exe /n,/e,/root,\\\\server\\shared','REG_SZ');
shell.RegWrite('HKCU\\SOFTWARE\\Classes\\CLSID\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\ShellFolder\\Attributes',0,'REG_BIN ARY');
shell.RegWrite('HKCU\\Software\\Microsoft\\Windows \\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{F D4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\\','My shared Documents','REG_SZ');
*/