Windows

Set up RunOnce and Run Registry keys for scripts and apps at logon

On Windows 11 (and 10), you can utilize the “Run” and “RunOnce” Registry keys to execute apps and scripts during startup as the user logs into their account. While using the “Startup” folder is always an option for running programs at logon, the Registry provides an alternative approach.

The “Run” key allows you to run a program every time the user logs into their Windows account. On the other hand, the “RunOnce” key executes a program only once, and then the system removes the key.

While the “Run” key can be employed for each logon, the “RunOnce” key should be reserved for specific instances, such as completing app setup, mapping a networked drive once, or changing a setting. It is not meant for consistent use.

You can configure these Registry keys on a per-user or per-device basis and set up multiple entries within these keys. One limitation is that the command cannot exceed 260 characters.

In this guide, I’ll outline what you need to know to leverage the Registry for running programs at logon on Windows 11 (and even on Windows 10).

Warning: It’s crucial to note that editing the Registry can lead to serious problems if not done correctly. Assume you know what you’re doing and have created a full backup of your system before proceeding.

Configure RunOnce key on Home windows

To arrange the RunOnce key by means of the Registry, use these steps:

  1. Open Begin on Home windows 11.
  2. Seek for regedit and click on the highest outcome to open the Registry.
  3. Open the next path to configure the “RunOnce” key for the present consumer:
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnce
  4. Open the next path to configure the “RunOnce” key for the machine:
    HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnce
  5. Proper-click the Run key, select New, and choose the String Worth possibility.Registry RunOnce create string
  6. Verify a reputation that describes the command and press Enter.
    Fast tip: By default, the system will delete the keys earlier than they even run, however you possibly can append a “!” (exclamation mark), reminiscent of “!MyRunKey,” to delete the string after the command runs efficiently. You may as well append the “*” (asterisk), reminiscent of “*MyRunKey,” to run the command in Protected Mode. In any other case, the keys might be ignored.
  7. Proper-click the newly created string and select the Modify possibility.
  8. Verify the command to the script or program to run.Registry RunOnce key configuration
    Fast tip: You may as well specify further choices as essential to run the command.
  9. Click on the OK button.

After completing the steps, the system will execute the command within the string only once, but specifically for users who are part of the “Administrators” group. This implies that it won’t work for regular users.

Configure Run key on Home windows

To configure the “Run” key on Home windows 11 (or 10), use these steps:

  1. Open Begin.
  2. Seek for regedit and click on the highest outcome to open the Registry.
  3. Open the next path to configure the “Run” key for the present consumer:
    HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun
  4. Open the next path to configure the “Run” key for the machine:
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun
  5. Proper-click the Run key, select New, and choose the String Worth possibility.

    Registry create Run string
    Set up RunOnce and Run Registry keys for scripts and apps at logon
  6. Verify a reputation that describes the command and press Enter.
  7. Proper-click the newly created string and select the Modify possibility.
  8. Verify the command to the script or program to run.
    Registry Run key configuration
    Set up RunOnce and Run Registry keys for scripts and apps at logon
    Fast tip: You may as well specify further choices as essential to run the command.
  9. Click on the OK button.

When you full the steps, the system will run the instructions within the Registry string each time the consumer logs in to the account.

Related Articles

Back to top button