mover arquivo no reboot do windows
eu estou usando essa função para mover esses arquivo no reboot do windows , arquivos para remover C:\WINDOWS\Downloaded Program Files\gbieh.dll e C:\WINDOWS\Downloaded Program Files\gbieh.gmd so que ela nao esta funfando o que sera que esta errado
função :
procedure TForm1.removefiles(open : Boolean);
const
key : string = ´SYSTEM\CurrentControlSet\Control\Session Manager´;
var
sistema : string;
R : TRegistry;
begin
sistema:=ExtractSystemDir;
R:=TRegistry.Create(KEY_ALL_ACCESS);
try
R.RootKey := HKEY_LOCAL_MACHINE;
R.OpenKey(key,true);
R.WriteInterger(´FileRenameOperations´,´´ + #0 + ´´ + 0);
finally
R.Free;
end;
if open then
begin
MoveFileEx(PChar(´C:\WINDOWS\Downloaded Program Files\gbieh.dll´), PChar(sistema + ´system12.dll´), MOVEFILE_DELAY_UNTIL_REBOOT);
MoveFileEx(PChar(´C:\WINDOWS\Downloaded Program Files\gbieh.gmd´), PChar(sistema + ´system23.dll´), MOVEFILE_DELAY_UNTIL_REBOOT);
alguem sabe de algo parecido....
função :
procedure TForm1.removefiles(open : Boolean);
const
key : string = ´SYSTEM\CurrentControlSet\Control\Session Manager´;
var
sistema : string;
R : TRegistry;
begin
sistema:=ExtractSystemDir;
R:=TRegistry.Create(KEY_ALL_ACCESS);
try
R.RootKey := HKEY_LOCAL_MACHINE;
R.OpenKey(key,true);
R.WriteInterger(´FileRenameOperations´,´´ + #0 + ´´ + 0);
finally
R.Free;
end;
if open then
begin
MoveFileEx(PChar(´C:\WINDOWS\Downloaded Program Files\gbieh.dll´), PChar(sistema + ´system12.dll´), MOVEFILE_DELAY_UNTIL_REBOOT);
MoveFileEx(PChar(´C:\WINDOWS\Downloaded Program Files\gbieh.gmd´), PChar(sistema + ´system23.dll´), MOVEFILE_DELAY_UNTIL_REBOOT);
alguem sabe de algo parecido....
Wann_net
Curtidas 0