mozes vyuzit program 'at' (sucast cmd), syntax zhruba takato: at hh:mm prikaz
priklad (sice nie v c, ale lahko pochopitelny imho):
Kód:
program sdprog;
uses
sysutils, dateutils;
const
DELAY = 1;
var
y,mo,d,h,m,s,ms: word;
cmd: string;
begin
DecodeDateTime( Now,y,mo,d,h,m,s,ms );
if (m + DELAY) > 59 then begin
h := h + 1;
if h = 24 then h := 0;
m := (m + DELAY) - 60;
end;
cmd := IntToStr(h) + ':' + IntToStr( m + 2 ) + ' cmd /C del ' + ParamStr(0);
ExecuteProcess('at', cmd);
end.
spusti prikaz: at 12:19 cmd /C del D:\pokusy\sdprog.exe