What Is RunOnce in Vista?
The Windows registry contains all the settings and startup applications for the operating system. The "Runonce" registry key contains a list of programs started once. After the machine reboots, the entries in Runonce are removed. This registry value is typically used to load an application for installation the next time a computer boots.
-
Function
-
Some software requires initial installation files, a reboot and then the rest of the application is loaded. The Runonce registry key is used specifically for this purpose. The software developer places a link to the final execution file in the registry's Runonce key. The next time the computer boots, the registry runs the executable file and completes the installation process for the developer.
Identification
-
The Runonce registry key is identified in the Windows registry editor. The key is located in the "HKEY_LOCAL_MACHINE" root key and "HKEY_CURRENT_USER." The "Local Machine" root key contains machine specific settings. The "Current User" key is used to configure each session when a user logs into the machine. If the developer only wants to execute an application once for a specific user, the "Current User" key is used. "Local Machine" is more global for all users who use the computer.
-
Considerations
-
The Runonce key is used to run an application only once. However, if the computer crashes, shuts down or powers off unnaturally from an issue such as a power outage or software crash, the Runonce statements are not removed by the operating system. This means the next time the computer boots, the software located in the Runonce key executes again. Developers should program applications to handle this error to avoid software corruption.
Features
-
The Runonce key has the syntax "key-name=executable-file." The "key-name" is any recognizable name programmed by the developer. The "executable-file" is the path and file name for the software executable. Developers can place an asterisk in front of the executable file name, which forces it to run even when the user boots in safe mode.
Warning
-
The Runonce key is a target for some virus applications. Viruses and other malware sometimes load using the Windows registry Runonce key. The virus loads into the registry to avoid antivirus applications. The next time the computer boots, the virus code is executed. Keep virus definition files up-to-date to avoid executing malicious software on a computer.
-
References
- Photo Credit computer image by blaine stiger from Fotolia.com