Solved

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

Posted on 2004-08-25
3
1,361 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

910 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

21 Experts available now in Live!

Get 1:1 Help Now