我想实现一个功能:增加一个开机自动运行的程序,我知道要在HKEY_LOCAL_MACHINE\MICROSOFT\WARESOFTWARE\Microsoft\Windows\CurrentVersion\Run(没有写错吧)增加一个表项,可是这个.reg的文件格式是什么样的?能不能给个例子呢?,比如我想把c:\a.exe设置为开机运行。

解决方案 »

  1.   

    REGEDIT
    ; This .REG file may be used by your SETUP program.
    ;   If a SETUP program is not available, the entries below will be
    ;   registered in your InitInstance automatically with a call to
    ;   CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.HKEY_CLASSES_ROOT\.sqr = Color.Document
    HKEY_CLASSES_ROOT\Color.Document\shell\open\command = COLOR.EXE %1
    HKEY_CLASSES_ROOT\Color.Document\shell\open\ddeexec = [open("%1")]
    HKEY_CLASSES_ROOT\Color.Document\shell\open\ddeexec\application = COLOR
        ; note: the application is optional
        ;  (it defaults to the app name in "command")HKEY_CLASSES_ROOT\Color.Document = Color Document
      

  2.   

    http://www.vckbase.com/document/viewdoc/?id=724
      

  3.   

    文件格式我已经知道了,可不知道怎么加一条开机启动某一程序的信息,比如将c:\a.exe设置为开机自动运行,应该怎么添加呢?Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
    "IMJPMIG8.1"="\"C:\\WINDOWS\\IME\\imjp8_1\\IMJPMIG.EXE\" /Spoil /RemAdvDef /Migration32"
    "PHIME2002ASync"="C:\\WINDOWS\\system32\\IME\\TINTLGNT\\TINTSETP.EXE /SYNC"