Avatar of Math Tec
Math Tec
Flag for United States of America asked on

Changing "Home Folder" name in windows server 2019 without renaming it locally in each computer or by using login script


I have windows server 2019. I created a home folder for all users and it's working fine. My question is there any way that can be done to change the home folder name without going to each computer and renaming the drive or by adding a login script?

I found the below script from (https://social.technet.microsoft.com/Forums/windowsserver/en-US/7bbf68de-4573-4c1d-bf72-d30f7c3477f7/home-folder-drive-mapping-adding-a-label?forum=winserverDS)

but I did not use it. I do not want to use login script.

Option Explicit
 Dim objNetwork, strDrive, objShell, objUNC
 Dim strRemotePath, strDriveLetter, strNewName

 strDriveLetter = "z:"
 strRemotePath = "\\server\home"
 strNewName = "HomeDrive"

' Section which actually (re)names the Mapped Drive
 Set objShell = CreateObject("Shell.Application")
 objShell.NameSpace(strDriveLetter).Self.Name = strNewName


' End of script. 

Open in new window

Windows OSWindows Server 2019Active Directory

Avatar of undefined
Last Comment

8/22/2022 - Mon

How are ypu pushing the "Home Folder" to the users?

To what end?
I can not interpret your scenario.

Lets say I am one of your users .
Is This an RDS setup?
How do I as a user access it.

Is this a share to which you redirect folders,

I.e. Currently \\server2019\soneshare\%username%\
You want to move the sharename to another drive where there is more space?
Math Tec

@arnold.Thank you for your reply.

Is This an RDS setup? No, it's login to the domain locally.

How do I as user access it? Is this a share to which you redirect folders? I created a shared folder with NTFS permission then at the user profile I assigned the path as " \\server2019\share\%username%\"  which shows to the user in my computer as a shared hard drive.
I want to rename this hard drive which is the home folder. Actually, this can be done by login script or by going to each computer and renaming it. I do not want to use a login script. additionally, it's not useful to go and rename it from each computer. Are there any other ways to do that?

Do you want to move the share name to another drive where there is more space? What do you mean? can you explain? I just want to rename the home folder name.  


Can you provide an example of what you are talking about.

What does the user see?
Often if you push the home folder using the properties of the user account within the AD.
it will show up as the username/name of the user representing the folder.

Is this also the destination to which you are redirecting user folders, documents, desktop, start menu. downloads, favorites, etc.

I am trying to see what you are trying to achieve.

i.e. on the server the share is on d:\myuserfolders accessed as sharename (share portion name of share) but your D: drive is running out of space and you want to relocate the folder to e:\mynewusershare.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy

> I want to rename this hard drive which is the home folder. I do not want to use a login script. additionally, it's not useful to go and rename it from each computer. Are there any other ways to do that?

You may be able to do this from the command line via the REG command.

The user can do it from the command line.

Replace ##Server#Sharename#Foldername with your actual values

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##Server#Sharename#Foldername" /f /v "_LabelFromReg" /t REG_SZ /d "NewName"


Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Forgot to mention... It works with %username% also, e.g.

 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##Server#Sharename#Foldername" /f /v "_LabelFromReg" /t REG_SZ /d "%username%"
Math Tec

Thank you for your reply. Below are the steps that I had done
1- Created share folder in the server with NTFS permission
2- Assign home directory to user from AD user and computer - user profile - under tab Home Folder.

3- The folder will show to the user as below4- I did not use Map drive to push the folder to the users. I did not use GPO. It's not Folder redirection. This folder will allow the users to save their data inside it.
5- I do know I can rename the drive locally from each computer. (this is not useful)
6- I do know this can be done using the Login script. ( I do not want to use login script)
7- I am looking to do that in an easy way

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

The name is reflecting the username whose folder it is.

What is the issue that necessitates the change you are pursuing?

Try using the Group policy preference as a test and push the same mapping to see whether the naming in that interface is what you are after.

You said you don't want to use a Login script. So, looks like your options left are:

1. Group policy preference (gpp) as Arnold mentioned
2. Registry key changed as I posted prior, which can be set via script or gpp
3. Some other script method... but that's essentially like the login script, right?

On another note... your last post image shows "This what will show to users and I want to change this name \\server\Homedir to name "My Personal Files"

Just to clarify, you want to change it to My Personal Files for all users?