這需要將要啟動的應用程序路徑寫到注冊表中具體的路徑是: hkey_local_machine/software/microsoft/windows/currentversion/run 只需要在上面的路徑下寫一個鍵并為此鍵設置一個當前應用程序的路徑即開機自載 具體的方法: 1、將下面這段代碼就是將鍵clock寫到注冊表中: '設置注冊表內的run屬性 dim strstring as string dim keyhand as long dim r as long strstring = app.path & "/" & app.exename & ".exe" r = regcreatekey(hkey_local_machine, "software/microsoft/windows/currentversion/run", keyhand) r = regsetvalueex(keyhand, "clock", 0, reg_sz, byval strstring, len(strstring)) r = regclosekey(keyhand) 2、下面這段代碼就是將注冊表的clock鍵刪除 '刪除注冊表內的run屬性 dim keyhand as long r = regopenkey(hkey_local_machine, "software/microsoft/windows/currentversion/run", keyhand) r = regdeletevalue(keyhand, "clock") r = regclosekey(keyhand) 正文