Главная страница
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.027 c
14-1127900165
TUser
2005-09-28 13:36
2005.10.23
А где в подмосковье выбрасывают с парашютом?


6-1120196627
Dust
2005-07-01 09:43
2005.10.23
Сколько данных читать из неблокирующего сокета?


11-1108804918
Sormy
2005-02-19 12:21
2005.10.23
KOL MP3 SetPosition and Lenght bug...


14-1127983768
ThreeTONE
2005-09-29 12:49
2005.10.23
Потянет ли LPT порт такое?


14-1128413996
Кручен-Верчен
2005-10-04 12:19
2005.10.23
Вопросик по Perl.