System hacks: about the boot auto-run and one-time auto-run

Usually, the boot-up auto-run program will work every time you start Windows, but there is another exception – is set up to run automatically only once at the next boot, after the boot will no longer run, its most common application is program updates or system upgrades, before the system reboot to perform the installation, reboot the system The most common applications are program updates or system upgrades, performing installation before a system reboot, and rebooting the system to perform automatic configuration and make the settings take effect. If we want to implement some one-time auto-run tasks by ourselves, we need to modify the registry or use third-party tools and software.

There are many ways to achieve autorun, and we have introduced many of them before, such as adding program shortcuts to the Windows “Startup” program group, adding autorun items under several Run entries in the registry (Figure 1), so we will not repeat them here.

2022A-AutoRun-1

The basic way of one-time autorun is similar to autorun, except that the registry entry to be added is changed to “RunOnce”. As the name suggests, RunOnce means one-time run, which is in the registry under “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOnce”, and the key value under this item will only run the program the next time Windows starts. Usually, the key under RunOnce is used to delete system files or locked files, and some software can also use it to perform some changes on restart.

Adding a program to RunOnce is as simple as creating a new string value under the above registry RunOnce entry and providing the full path to the program you want to run for that value (Figure 2).

2022A-AutoRun-2

If you don’t want to risk modifying the registry manually, you can use the RunItOnce free tool (https://www.raymond.cc/blog/download/did/1337/). Running the software will open a dialog box to select the program to run at once on next startup (accept .exe, .cmd, .bat files or Windows shortcuts) (Figure 3). After clicking “Open”, a pop-up message “RunitOnece Succeed for <a program>” will appear, indicating that the one-time automatic startup item is added.

2022A-AutoRun-3

However, this tool can only add, not edit or delete RunOnce keys. If you add a mistake and need to delete it, you can download a registry REG file (https://www.raymond.cc/blog/download/did/1336/) and run it to delete any key value created by RunItOnce.

When Windows automatically starts an application, there are so many different ways to load it that it can be difficult to keep track of. If you need to clarify what Windows is launching when it runs and from which location, you can use the Sysinternals Autoruns Autostart Management Utility (Figure 4).

2022A-AutoRun-4

QQ图片20210420165237

Leave a Comment