Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing "user" folder from the desktop

Status
Not open for further replies.

acl03

MIS
Jun 13, 2005
1,077
US
Is there a way, via GPO or otherwise, to remove the "user" (not sure the actual name) from the desktop for all users?

This is a terminal server and I don't want that icon on the desktop, even for users who have never been on that server before.

This folder contains shortcuts to the users documents, saved games, etc.

If this is possible, is there a way to restrict access altogether for that "folder"?





Thanks,
Andrew

[medal] Hard work often pays off over time, but procrastination pays off right now!
 
Is the folder given the name of the logged on user? If so then you could delete it via a local login script.

Code:
Const DESKTOP = &H10&
Dim objFSO, objShell, WSHNetwork, objFolder, objFolderItem, strFolderDpath, UserName
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(DESKTOP)
Set objFolderItem = objFolder.Self
strFolderDpath = objFolderItem.Path
Set WSHNetwork = CreateObject("WScript.Network")
UserName = WSHNetwork.UserName
If objFSO.FolderExists(strFolderDpath & "\" & UserName) Then
	Set killFolder = objFSO.GetFolder(strFolderDpath & "\" & UserName & "\")
	killFolder.Delete True
End If

Note: I am not 100% certain that the desktop can be grabbed with this method since the docs for it have not been updated since 2008 and I don't have a test server readily available. It worked for me on my Windows 7 machine so I believe it should be fine. Please report back.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Mark,

Thanks for the reply. Not sure if this will work, as it is not really a folder. It's more of a symbolic link to the user's profile, sort of how the "My Documents" shortcut appears on the desktop, even though it's not in the "desktop" folder when you browse to it in explorer.

If you were to browse to the desktop via CMD, for example, a dir command would not show this user "folder".

Thanks,
Andrew

[medal] Hard work often pays off over time, but procrastination pays off right now!
 
Guys, not sure if you are still looking but i found the following which was useful for me:
--------
Hello,



Yes, when the classic Start menu is used, the following icons are placed on the desktop: User's Files, Computer, and Network. The group policy setting "Remove the My document icon on the desktop" has no effect on hiding the user's files folder. Please correct me if there is any misunderstanding.



To hide user's files folder (c:\users\%username%) while classic start menu is enabled in Windows Vista and Windows Server 2008, you may change the registry to achieve this.





Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu\

Value: {59031a47-3f72-44a7-89c5-5595fe6b30ee}

Type: REG_DWORD

Data: 0 (not hide, display)

1 (hide)



You can write a custom ADM file or a logon script to modify this registry key on clients to hide the user's files folder.



Hope it helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top