DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 284193 - Last Review: October 30, 2006 - Revision: 3.6

This article was previously published under Q284193
Notice
This article applies to Windows 2000. Support for Windows 2000 ends on July 13, 2010. The Windows 2000 End-of-Support Solution Center (http://support.microsoft.com/?scid=http%3a%2f%2fsupport.microsoft.com%2fwin2000) is a starting point for planning your migration strategy from Windows 2000. For more information see the Microsoft Support Lifecycle Policy (http://support.microsoft.com/lifecycle/) .
Notice
This article applies to Windows 2000. Support for Windows 2000 ends on July 13, 2010. The Windows 2000 End-of-Support Solution Center (http://support.microsoft.com/?scid=http%3a%2f%2fsupport.microsoft.com%2fwin2000) is a starting point for planning your migration strategy from Windows 2000. For more information see the Microsoft Support Lifecycle Policy (http://support.microsoft.com/lifecycle/) .

On This Page

SUMMARY

This article describes how to configure a logon script, or program to run one time. These steps apply only to new users who have never logged on to the computer. If a user already has a local user profile, or a roaming profile, the script will not run.

Configure a Script to Run Once When a New User Logs On

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756  (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows

The Default User profile is created when Windows is installed. The first time a user logs on to a workstation (or domain), the Default User profile is copied to the user's profile.

To configure a script to run one time when a new user logs on, follow these steps:
  1. At a command prompt, type regedt32.exe.
  2. Click HKEY_USERS on the Windows menu.
  3. Click HKEY_USERS in the left panel, and then click Load Hive on the Registry menu.
  4. Locate the Profilepath\Default User\Ntuser.dat file, and then click Open. Give the hive a name such as "Test" when you are prompted.

    NOTE: The Ntuser.dat file is hidden. If you are unable to locate, or load the Ntuser.dat file, in Windows Explorer, on the Tools menu, click Folder Options, and on the View tab, make sure that Hide file extensions for known file types is not selected, and that Show hidden files and folders is selected.For additional information about Windows 2000 User Profile storage, click the article number below to view the article in the Microsoft Knowledge Base:
    228445  (http://support.microsoft.com/kb/228445/EN-US/ ) User Profile Storage in Windows 2000
  5. Locate the following registry key where "test" is the name given to the loaded Ntuser.dat hive:
    HKEY_USERS\Test\Software\Microsoft\Windows\CurrentVersion\Runonce
  6. Click the Runonce key in the left pane, and then click Add Value on the Edit menu.
  7. Enter the following information for the new value:
    Value name: test.bat (you can name this anything)
    Data Type: REG_SZ
    String: c:\test.bat (this is the path to the file, and the file name)
  8. Click the "Test" hive, and then click Unload Hive on the Registry menu.
As mentioned above, this will run for a user who does not already have a user profile. Any local User Profiles will be listed on the User Profile tab in System properties.

REFERENCES

For additional information about how to create a Default User profile for all users in a domain, click the article number below to view the article in the Microsoft Knowledge Base:
168475  (http://support.microsoft.com/kb/168475/EN-US/ ) How to Create a Base Profile for All Users

APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
Keywords: 
kbgpo kbhowto kbhowtomaster kbprofiles kbsetup KB284193
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support