Главная страница
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.026 c
14-1128055512
CHES
2005-09-30 08:45
2005.10.23
Примеры "нестандартных" решений.


1-1128077265
Vladimir88
2005-09-30 14:47
2005.10.23
try ... finally except


3-1126629515
redlord
2005-09-13 20:38
2005.10.23
запрос не возвращающий значений


14-1126443842
whatisthematrix1
2005-09-11 17:04
2005.10.23
Просто зашел посмотреть...


3-1126093577
stud
2005-09-07 15:46
2005.10.23
сортировка в dxMemData