// 十处可供修改注册表:HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run
.../RunService _
.../RunOnce |__(运行后系统自动删除)
.../RunServiceOnce _|
文件:
win.ini [windows] load= (最小化运行)
win.ini [windows] run=
Autoexec.bat
{windir}\winstart.bat
目录:
{windir}\start menu\programs\startup
{windir}\All users\start menu\programes\startup
.../RunService _
.../RunOnce |__(运行后系统自动删除)
.../RunServiceOnce _|
文件:
win.ini [windows] load= (最小化运行)
win.ini [windows] run=
Autoexec.bat
{windir}\winstart.bat
目录:
{windir}\start menu\programs\startup
{windir}\All users\start menu\programes\startup
var
reg:Tregistry;
begin
reg:=tregistry.Create;
try
reg.RootKey:=HKEY_LOCAL_MACHINE;
if(reg.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices',false)) then
begin
reg.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices',true);
reg.WriteString ('changedesktop',extractfilepath(application.ExeName)+'Desktop.exe');
reg.CloseKey;
end
finally
reg.CloseKey ;
reg.Free;
end;
Close;
end;
uses
Registry;......var
Reg: TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey(Software\Microsoft\Windows\CurrentVersion\Run',False);
Reg.WriteString('sysExplr','d:\SthVCD\SysExplr.EXE');//换成你的
Reg.CloseKey;
Reg.Free;
end;