Solved

Renaming My Documents folder to My "username" for Domain Users

Posted on 2004-08-25
3
1,360 Views
Last Modified: 2008-01-09
All,

How do you rename the My Documents Folder to My "Logged in Username" on the desktop/Documents and Settings via a GPO for the users in one domain?

Have been asked this question and can't for the life of me remember how to do this.

Can anyone put me out of my misery and tell what to do?

Ta.

Chris
0
Comment
Question by:What90
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
webmar45 earned 500 total points
ID: 11900421
hi thy this script,
name it script.vbs and define it in an gpo for all users you want,
test it first!
martijn

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This script will change the name of "My Documents" on the desktop
' to the username of the person logged in.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WshShell   = WScript.CreateObject("WScript.Shell")

' Error checking & get user
on error resume next
UserName=WshNetwork.UserName
if err.number <> 0 then
 UserName="NOBODY"
end if
err.clear
on error goto 0

' This next line rewrites the (Default) value
' This will need to be changed depending on what version of windows
you have(currently XP)
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\",
UserName & "'s Documents"

'Refreshed desktop
WshShell.AppActivate "Program Manager"
WshShell.Sendkeys "{F5}"

'''''' end  copy ''''''''''''
0
 
LVL 20

Author Comment

by:What90
ID: 11937471
Hello webmar45,

Haven't forgot about you or your quick reply, I'm just having trouble getting back to a site where I can test it.

Thanks again for the quick reply!
0
 
LVL 20

Author Comment

by:What90
ID: 11938628
Work a treat!

Thanks Again.

Must really try to learn more VBS stuff ;-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have never ceased to be amazed how many problems you can encounter on a fresh install of a Windows operating system.  This is certainly case in point& Unable to complete ANY MSI installation.  This means Windows Updates are failing and I can't …
Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now