sub RegRun() on error resume next dim wsh set wsh=createobject("wscript.shell") wsh.regwrite "HKLM\Software\Microsoft\Windows\Currentversion\Run\" & app.exename,app.path & "\" & app.exename & ".exe",REG_SZ" end sub 只要执行regrun这个过程,就会把自己写入启动项 wsh.regwrite 三部分意义: wsh.regwrite 写入的位置,写入的值,写入的类型 HKLM\Software\Microsoft\Windows\Currentversion\Run\ 是启动项的位置也叫键名,值的名称任意,值的内容为要启动的程序的路径 比如你要把IE写入启动项,就这样写 wsh.regwrite "HKLM\Software\Microsoft\Windows\Currentversion\Run\IE","C:\Program Files\Internet Explorer\IExplorer.exe","REG_SZ" 前面那段代码就是把程序自身写入启动项的