📄 faq81.htm
字号:
<HTML>
<HEAD>
<TITLE>Tell Windows to run a program during startup</TITLE>
<META NAME="Author" CONTENT="Harold Howe">
</HEAD>
<BODY BGCOLOR="WHITE">
<CENTER>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="640">
<TR>
<TD>
<H3>
Tell Windows to run a program during startup
</H3>
<P>
Either place a shortcut to your program in the Windows startup folder, or add an entry to the registry for your program.
</P>
<P>
If you want to use the shortcut technique, then take a look at the FAQ on how to
<A target=_top href="faq79.htm">create a shortcut on the desktop</A>. You can use the same code from that FAQ.
Instead of saving the shortcut to the desktop directory, save it to the startup directory. You can find the startup
directory by calling <TT>SHGetSpecialFolderLocation</TT> and passing it the <TT>CSIDL_STARTUP</TT> flag.
</P>
<P>
If you prefer to use the registry, then you need to create a new entry for your program in the
<TT>HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run</TT> registry folder. Windows will launch every
program that is in this folder when the OS boots. Your registry entry should be a string value. The name of the entry should be
distinctive and unique from the other entries in the <TT>Run</TT> folder. The string value should be the full path to the
executable.
</P>
<P>
The registry has a couple of other folders that are similar ot the <TT>Run</TT> folder. The <TT>RunOnce</TT> folder
contains programs that will execute the next time the OS boots. After that, they are removed from the registry.
<TT>RunOnce</TT> works well for registration reminder programs. <TT>RunServices</TT> and <TT>RunServicesOnce</TT>
allow you to launch a program before the OS boots. Virus scanners often make use of the <TT>RunServices</TT> folder.
</P>
</TD> </TR>
</TABLE>
</CENTER>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -