Code:
rem =========================================================
rem My Documents back on Desktop
rem Take ownership
C:\Drivers\PostInst\SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}" -ot reg -actn setowner -ownr "n:Administrators" -rec yes
rem Permissions to FC for Administrators
C:\Drivers\PostInst\SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}" -ot reg -actn ace -ace "n:Administrators;p:full" -rec yes By default, the key HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103} has NTFS permissions which prohibit anyone from writing to it.
The above first takes ownership of the key, then changes the permissions to allow the local group "Administrators" to write to it.
Code:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\ShellFolder" /v "Attributes" /t "REG_DWORD" /d "4034920765" /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shell\cmd" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}" /ve /t "reg_sz" /d "Documents" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\DefaultIcon" /ve /t "reg_expand_sz" /d ^%SystemRoot^%\system32\imageres.dll,-112 /f This then changes the values of key HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103} (which Administrators can now write to). The values changed are to make it similar to the settings found on an XP workstation.
Code:
rem unhide My Docs
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{450D8FBA-AD25-11D0-98A8-0800361B1103}" /t "REG_DWORD" /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{450D8FBA-AD25-11D0-98A8-0800361B1103}" /t "REG_DWORD" /d 0 /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{450D8FBA-AD25-11D0-98A8-0800361B1103}" /v "Removal Message" /f The above sets both "New" (Win7) and "Classic" Start Menu so that the "My Documents" is visible.
Code:
rem Hide User profile desktop namespace
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t "REG_DWORD" /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t "REG_DWORD" /d 1 /f Hopefully speaks for itself, but the above sets both "New" (Win7) and "Classic" Start Menu so that the "Profiles folder" is hidden.
These changes came about by looking at the above reg values on an XP workstation, and then the same on a 7 workstation. And then contrasting/comparing the two, and manually changing each 7 difference until I got the desired effect.
If you're using GPOs, I'm sure there's a way of importing custom registry changes and NTFS permissions changes - it's been a long time since I've had anything to do with GPOs, so you'll have to forgive my vagueness.
I hope this has helped a little?