Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows XP / Customization / October 2003

Tip: Looking for answers? Try searching our database.

Rename My documents to username automatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bj - 27 Oct 2003 22:15 GMT
I work for a school and it would be nice to have the My documents
folder on the desktop actually be the username of the person logged in
at that time.  They are logging into a windows domain, and using XP
workstations.

I have found that changing the following registry keys will change the
name, but I just don't how to script it into a batch file or vb
script, and have them run at logon.

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}]
@="My Documents Local"

and

[HKEY_USERS\S-1-5-21-1910989853-1314919565-926709054-1433\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}]
@="My Documents Local"

Thanks
bj
tfa - 27 Oct 2003 23:41 GMT
>-----Original Message-----
>I work for a school and it would be nice to have the My documents
[quoted text clipped - 5 lines]
>name, but I just don't how to script it into a batch file or vb
>script, and have them run at logon.

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersio
n\Explorer\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}]
>@="My Documents Local"
>
>and
>
>[HKEY_USERS\S-1-5-21-1910989853-1314919565-926709054-1433\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{
450D8FBA-AD25-11D0-98A8-0800361B1103}]
>@="My Documents Local"
>
>Thanks
>bj
>.

I do this daily.
Right click on the My Documents folder, select rename and
rename it.
bj - 28 Oct 2003 20:01 GMT
> I work for a school and it would be nice to have the My documents
> folder on the desktop actually be the username of the person logged in
> at that time.  They are logging into a windows domain, and using XP
> workstations.

I have found a way to do this so I thought it would be nice to share
with everyone.  It is a vb script that my version only works in xp but
by adding the correct registry entry it will work for any version.

1. Open notepad
2. copy the folowing text into it (don't forget to fix the word
wrapping).

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 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 ''''''''''''

3. save the file as "something.vbs" - make sure you put quotes arround
the name
4. done.

Bj

P.S. Please check out my website www.askbj.com  I constantly update it
with new tips, tricks & downloads.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.