//sProgTitle : Name of your program //sCmdLine : program,always its extention is EXE //bRunOnce :True --> if you want to run your program just once. // False --> specified program will be executed every time Windows startsup. procedure RunOnStartup( sProgTitle, sCmdLine : string; bRunOnce : boolean ); var sKey : string; reg : TRegIniFile; begin if( bRunOnce )then //Run at Once! sKey := 'Once' else sKey := ''; reg := TRegIniFile.Create( '' ); reg.RootKey := HKEY_LOCAL_MACHINE; reg.WriteString('Software\Microsoft'+ '\Windows\CurrentVersion\Run' + sKey + #0, sProgTitle, sCmdLine ); reg.Free; end;Example: RunOnStartup( 'Title of my program', 'GoStock.exe', False );
1)我公司有个人把自已的程序替换了runonce.dll。同理,你可以替换掉其它类似的Windows文件(参考各种木马病毒)
2)计划任务。
3)ActiveDestop桌面(参考“欢乐时光”病毒)TO duanfeng(段)
启动列表:见到开始菜单上的启动没有?
//sCmdLine : program,always its extention is EXE
//bRunOnce :True --> if you want to run your program just once.
// False --> specified program will be executed every time Windows startsup.
procedure RunOnStartup(
sProgTitle,
sCmdLine : string;
bRunOnce : boolean );
var
sKey : string;
reg : TRegIniFile;
begin
if( bRunOnce )then //Run at Once!
sKey := 'Once'
else
sKey := ''; reg := TRegIniFile.Create( '' );
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.WriteString('Software\Microsoft'+ '\Windows\CurrentVersion\Run' + sKey + #0,
sProgTitle,
sCmdLine );
reg.Free;
end;Example:
RunOnStartup(
'Title of my program',
'GoStock.exe',
False );