大网数据广告活动
远程桌面与会话

Terminal Server user's Home Directory is not set correctly

· 52CE 我爱测

Provides a resolution to an issue where Terminal Server user's Home Directory is not set correctly

This article provides a resolution to an issue where Terminal Server user's Home Directory is not set correctly.

Original KB number:   230165

Symptoms

Home directories are not mapped correctly for users with existing profiles. Their home directory and root drive point to the default path of %SystemRoot%\Profiles%Username%. The drive letter set in the home directory connect box does appear in My Computer in the Terminal Server session. No error messages are displayed to the user.

Cause

This problem occurs because the user's profile already contains a drive mapped to the same drive letter that was specified for the user's home directory. After the system finds that the drive letter is already in use, it does not map the drive and does not correctly set the homepath or homedrive variables. The user retains the default settings pointing to:

  • Home Directory Path: %SystemRoot%\Profiles%Username%
  • HOMEDRIVE=C:
  • HOMEPATH=\Wtsrv\Profiles%Username%

It also affects the root drive because it is set through the Usrlogon.cmd script when the user logs on. Listed below is the portion of Usrlogon.cmd that connects rootdrive:

Rem Map the User's Home Directory to a Drive Letter
Rem

Net Use %RootDrive% /D >NUL: 2>&1
Subst %RootDrive% /d >NUL: 2>&1
Subst %RootDrive% %HomeDrive%%HomePath%

Resolution

To resolve this issue, delete the mapped drive from the user's profile or set the home directory to another drive letter.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Server · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。