Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2005.10.23;
Скачать: [xml.tar.bz2];

Вниз

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

 
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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.037 c
3-1126238326
DimonS
2005-09-09 07:58
2005.10.23
При записи кэшированных данных выдается ошибка:


11-1109578928
NorthMan
2005-02-28 11:22
2005.10.23
[Error] Unit1_1.inc: Identifier redeclared: NewForm1


1-1128071792
Alex7
2005-09-30 13:16
2005.10.23
Поиск компонента во фрейме


14-1128079411
oldman
2005-09-30 15:23
2005.10.23
Вера, Надежда, Любовь и мать их Софья.


2-1128050000
Pop_Max
2005-09-30 07:13
2005.10.23
Работа в сети





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский