Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.10.23;
Скачать: CL | DM;

Вниз

Запуск программы по расписанию   Найти похожие ветки 

 
STUDENT_RU   (2005-10-01 12:29) [0]

Добрый день...
Помогите, пожалуйста, решить проблему.
Написал служебную программу. Мне необходимо, чтобы она запускалась в определенный день недели и в определенное время. Подразумевается, что машина не глушится. То есть поместить в реестре в RUN не подходит.
Может, поместить в планировщик задач? Как это сделать программно, а не через мастер?


 
Eraser ©   (2005-10-01 12:30) [1]


> STUDENT_RU   (01.10.05 12:29)

Пиши свой планировщик, так надежнее.


 
TUser ©   (2005-10-01 12:40) [2]

F:\BioProg>at /?
The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
   [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     Specifies a remote computer. Commands are scheduled on the
                  local computer if this parameter is omitted.
id                 Is an identification number assigned to a scheduled
                  command.
/delete            Cancels a scheduled command. If id is omitted, all the
                  scheduled commands on the computer are canceled.
/yes               Used with cancel all jobs command when no further
                  confirmation is desired.
time               Specifies the time when command is to run.
/interactive       Allows the job to interact with the desktop of the user
                  who is logged on at the time the job runs.
/every:date[,...]  Runs the command on each specified day(s) of the week or
                  month. If date is omitted, the current day of the month
                  is assumed.
/next:date[,...]   Runs the specified command on the next occurrence of the
                  day (for example, next Thursday).  If date is omitted, the
                  current day of the month is assumed.
"command"          Is the Windows NT command, or batch program to be run.


 
STUDENT_RU   (2005-10-01 14:04) [3]

Спасибо за ответы.
Но как мне, допустим, прописать комманду AT , то есть где?

(простите меня тупого...)


 
Набережных С. ©   (2005-10-01 15:31) [4]

procedure TForm1.Button4Click(Sender: TObject);
var
 Schd: ITaskScheduler;
 Item: ITask;
 Tgr: ITaskTrigger;
 TaskTrigger: TTaskTrigger;
 Index: Word;
 PF: IPersistFile;
begin
 Schd:=CreateComObject(CLSID_CTaskScheduler) as ITaskScheduler;
 OleCheck(Schd.NewWorkItem("My Super task", CLSID_CTask, IID_ITask, IUnknown(Item)));
 OleCheck(Item.SetApplicationName("MySuperApplication.exe"));
 OleCheck(Item.CreateTrigger(Index, Tgr));

 FillChar(TaskTrigger, SizeOf(TaskTrigger), 0);
 with TaskTrigger do
 begin
   cbTriggerSize:=SizeOf(TTaskTrigger);
   DecodeDate(Now, wBeginYear, wBeginMonth, wBeginDay);
   wEndYear:=wBeginYear + 100;
   wEndMonth:=wBeginMonth;
   wEndDay:=wBeginDay;
   wStartHour:=12;
   rgFlags:=Ord(TASK_TRIGGER_FLAG_HAS_END_DATE);
   TriggerType:=TASK_TIME_TRIGGER_DAILY;
   Type_.Daily.DaysInterval:=1;
 end;

 OleCheck(Tgr.SetTrigger(@TaskTrigger));
 
 PF:=Item as IPersistFile;
 OleCheck(PF.Save(nil, true));
end;



Страницы: 1 вся ветка

Текущий архив: 2005.10.23;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.045 c
3-1126646105
TALLA
2005-09-14 01:15
2005.10.23
MySQL через ADO, invalid field size


1-1127800486
Урмат
2005-09-27 09:54
2005.10.23
Работа с модемом


1-1127976591
Николай1
2005-09-29 10:49
2005.10.23
Конфликт XPManifest и форм загруженных из Dll


2-1127915344
Igor_thief
2005-09-28 17:49
2005.10.23
Tnotebook


1-1127983952
NikNet
2005-09-29 12:52
2005.10.23
Как загрузить Streem в Image?