大网数据广告活动
账户与安全

Assign a logon script to a profile

· 52CE 我爱测

Describes how to assign a logon script to a profile for a local user.

This article describes how to assign a logon script to a profile for a local user.

Applies to:   Windows Server (All supported versions), Windows client (All supported versions)
Original KB number:   324803

Summary

This article describes how to assign a logon script to a profile for a local user's account in Windows Server 2003. This logon script runs when a local user logs on locally to the computer. This logon script does not run when the user logs on to the domain.

Note: You must be logged on as Administrator or as a member of the Administrators group to complete this procedure. If your computer is connected to a network, network policy settings may also prevent you from completing this procedure.

How to assign a logon script to a user's profile

  1. Click the Start, point to Administrative Tools, and then click Computer Management.

  2. In the console tree, expand Local Users and Groups, and then click Users.

  3. In the right pane, right-click the user account that you want, and then click Properties.

  4. Click the Profile tab.

  5. In the Logon script box, type the file name (and the relative path, if necessary) of the logon script.

    [!NOTE] If the logon script is stored in a subfolder of the default logon script path, put the relative path to that folder in front of the file name. For example, if the Startup.bat logon script is stored in \\ComputerName\Netlogon\FolderName, type FolderName\Startup.bat .

  6. Click Apply, and then click OK.

    [!NOTE]

    • Logon scripts that are stored on the local computer apply only to users who log on to the local computer.

    • Local logon scripts must be stored in a shared folder that uses the share name of Netlogon, or be stored in subfolders of the Netlogon folder.

    • The default location for local logon scripts is the Systemroot\System32\Repl\Imports\Scripts folder. This folder is not created on a new installation of Windows. Therefore, the SystemRoot\System32\Repl\Imports\Scripts folder must be created and shared out by using the Netlogon share name.

    • If you do not want to create the Netlogon share in the default location, put the logon script in any folder that the user can access during logon, and then share this folder.

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)

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

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