Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Windows 7 Professional one can right-click the user in the Computer Management's Local Users and Groups to set the Logon script on the Profile tab. Unfortunately, Windows 7 Home Premium does not (seem to) have the Local Users and Groups in the Computer Management. How to configure the logon script on Windows 7 Home Premium.?

share|improve this question
In a standalone system, is there any advantage in configuring a logon script over just putting it in the Startup folder? – grawity Mar 21 '11 at 9:15
The advantage is that the script will be loaded very early, e.g. before launching other applications. This is very useful to mount encrypted partitions. – Mike L. Mar 21 '11 at 12:30

You're right, this MMC snap-in is disabled unless you have at least Windows 7 (or Vista) Professional.

You should be able to configure user properties using the net user command:

net user UserName /scriptpath:logon.bat

The script location:

Local logon scripts must be stored in a shared folder — or subfolders of the shared folder — named Netlogon. If this folder does not exist by default, you must create it. To specify a logon script that is stored in a subfolder of the Netlogon folder, precede the file name with the relative path to that folder. For example, to assign the Startup.bat logon script that is stored in \ComputerName\Netlogon\FolderName to a local user, in Logon script type FolderName\Startup.bat

share|improve this answer
Where is the directory "\ComputerName\Netlogon\FolderName" located? – Mike L. Mar 21 '11 at 12:29
@mklhmnn: Wherever you want it. The example given is for a domain, with one server holding all scripts; domain controllers have a share \\servername\Netlogon for this purpose. If you give a relative path, it will be looked for in the DC's Netlogon share. (Behavior unknown for standalone systems.) But you can give an absolute path, e.g. C:\WINDOWS\Misc\logon.cmd. – grawity Mar 21 '11 at 12:37
Wherever you want - for example, create a folder c:\logon and share it as Netlogon. – Siim K Mar 21 '11 at 12:38
@grawity using /scriptpath:path You can't use an absolute path. – Hanan N. Dec 15 '14 at 11:11
up vote 7 down vote accepted

Summary for what I did to resolve this issue:

  • I've created a script in C:\Windows\System32\repl\import\scripts\<username>.bat
  • invoked net user <username> /scriptpath:<username>.bat

Because Windows 7 Home did not wait until this script had been finished and continued to load other applications, I also needed to create a DWORD entry named RunLogonScriptSync at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon in the registry setting the value to 1.

share|improve this answer
Is there a way to reverse this command? In other words turn off a script you assigned to a user profile? – Radical924 Jan 25 '15 at 10:46

I’m using Win 7 Premium Home on a standalone system and wanted to run a logon script to mount an encrypted volume. Searching the net gave only complicated results (gpedit, registry update). My solution is very simple: I created on C: a folder (with a name whatever you want) and put my script into it. This folder must be shared with the share name “Netlogon” It works! At least on my local system.

share|improve this answer

System error 5 has occurred.

Access is denied.

If you get an error like this when running the net user command, make sure you run CMD as adminisitrator (use right click and select "Run as administrator")!

share|improve this answer

You can also just create a task using task scheduler and setting the trigger to run the script at logon.

share|improve this answer
This answer could be improved by including procedures and steps involved to configure a script to run in task scheduler. – Will.Beninger May 23 '14 at 1:23

You still use UI to configure logon script in Windows 7

Open "Control Panel" -> "User Accounts" -> "User Accounts" -> "Manage User Accounts" -> "Advanced" -> "Advanced" to access "Local Users and Groups (Local)" MMC snap-in.

or just launch from cmd shell: mmc.exe %SystemRoot%\system32\lusrmgr.msc computername=localmachine

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.