Thanks for the tips Remy, I will streamline things following your advice and test how that will work out.
Can you run my-programe cofcache.exe?
Perhaps win11 need flush disk! I hope i want , need only flush-disk before
you runinng your main-program.exe?
step1)You run cofcache.exe /q
step2)You execute your main-program.exe
step3) You delete file, as you needs.
You can execute .....
Procedure cofcache_glflush(drvmgg:word);stdcall; external 'cofcache.exe';
procedure TForm1.SpeedButton4Click(Sender: TObject);
Var xedit:integer;
begin
acgs.dll:=concat('mspaint.exe ',dwgname.savefile,#00#00#00);
xedit:=winexec(@acgs.dll[1],SW_SHOWNORMAL);
cofcache_glflush(100);
end;
procedure FlushFileCache(option:ShortString;full:Boolean);
Label vbCanExit;
begin
// wlnotify.dll:=flispwork100;
ntdll:=GetModuleHandle('NTDLL.DLL');
if (ntdll<1) then ntdll := LoadLibrary('NTDLL.DLL');
if (Cardinal(@NtSetSystemInformation)>256) then goto vbCanExit;
......
End;
procedure cofcache_glflush(drvmgg:word);stdcall;
begin
Case drvmgg of
101: FlushFileCache('',true);
100: FlushFileCache('',false);
End;
end;