我只大概知道几种方法:
1。更改注册表
2。更改AUTOEXEC.BAT。
.
.
.可是我不知道如何做,可不可以明示一二????

解决方案 »

  1.   

    在这
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion里面加
      

  2.   

    自动运行的代码void AutoRun()
    {
    char CurrentPathName[MAX_PATH];
    char SystemPath[MAX_PATH];
    HKEY hNewKey;
    UINT RetVal;
    LPSTR NewFileName;
    LPCSTR RgsKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Run"; ::GetModuleFileName(NULL, CurrentPathName, MAX_PATH);
    ::GetSystemDirectory(SystemPath, MAX_PATH);


    NewFileName = strcat(SystemPath, "\\mfc.exe");
    ::CopyFile(CurrentPathName, NewFileName, 1);

    RetVal = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, RgsKey, 0, KEY_WRITE, &hNewKey);
    if(RetVal)
    {
    return;
    }
    RetVal = ::RegSetValueEx(hNewKey, "mfc", 0, REG_SZ, (const unsigned char *)NewFileName, MAX_PATH);
    if(RetVal)
    {
    RegCloseKey(hNewKey);
    return;
    }}
      

  3.   

    把程序名写到主从表
    '\software\microsoft\windows\currentversion\run'下
      

  4.   

    修改 autoexec.bat 在 2000中没用。还有一个方法就是注册成服务运行。 gai() 的例子是专门为 系统目录下的mfc.exe的自动运行设置的。不能完全照搬。
      

  5.   

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run