Close Zennoposter and save task safely after a specified time (I would like to share)

legorange

Client
Регистрация
22.04.2020
Сообщения
13
Благодарностей
34
Баллы
13
Hello, I would like to share,

I have seen that some users need this option.

When there are many threads, the practice has shown that restarting every hour or two hours the speed is greater when eliminating dead processes.

I use the attached zennoposter template:
stop_save_task_safely_zennoposter.zp (it has a parameter in seconds, but it is only so that you can see the execution of the task)

The zennoposter template is called from a windows task:
Stop_save_task_safely_zennoposter_v02.xml

(please, when importing the windows task, modify your user data and indicate the time when you want zennoposter to restart and save the tasks)


<LogonTrigger>
<Repetition>
<Interval>PT1H</Interval> ****once every hour****
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<Enabled>true</Enabled>
<UserId>XXXXXXXX\XXXXXXXXX</UserId>
<Delay>PT15M</Delay> ****delay 15 minutes from the start of the session***
</LogonTrigger>


Windows task calls "% ZennoPosterCurrentPath% \ TasksRunner.exe"
and in parameters we add -o SetTries 1 -names "Stop_save_task_safely_zennoposter"

Adding a thread for the zennoposter template to start running.

The c# code will call Process.CloseMainWindow() from System.Diagnostics (add using System.Diagnostics in using directives)
Only if the window is the one of zennoposter with interface (MainWindowHandle! = IntPtr.Zero)

You must check these options in zennoposter setting:

In Execution:

78908


In Other:

78909


The template must be incorporated into zennoposter but not executed, since it will be activated by the windows task.

78910



Don't forget to incorporate the automatic zennoposter restart as a windows task (AutoStartZP.xml) To complete the stop-start cycle. You can find it here:



Best,
Legorange
 

Вложения

Последнее редактирование:

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)