Community Discussions and Support
How to Stop pegasus mail via command in script

Hello, I use version 4.8
I need to stop Pegasus mail every day in some time by script scheduled in Windows scheduler. I use command :
taskkill /IM "winpm-32.exe" /F
DEL "<folder path>\pmail\MAIL\ADMIN\MAILBOXP.LCK"


its working well but problem with temp folder and files
c:\Users\user\AppData\Local\Temp*.PM$


they still stay on disk and are not deleted. Probably because Pegasus mail was not stopped via GUI and click on File - exit


Does exist some better command to close program as "Graceful close" ? So Pegasus mail also should delete temporary files.


Hello, I use version 4.8 I need to stop Pegasus mail every day in some time by script scheduled in Windows scheduler. I use command : taskkill /IM &quot;winpm-32.exe&quot; /F DEL &quot;&lt;folder path&gt;\pmail\MAIL\ADMIN\MAILBOXP.LCK&quot; its working well but problem with temp folder and files c:\Users\user\AppData\Local\Temp\*.PM$ they still stay on disk and are not deleted. Probably because Pegasus mail was not stopped via GUI and click on File - exit Does exist some better command to close program as &quot;Graceful close&quot; ? So Pegasus mail also should delete temporary files.

You can use Task Scheduler to run Pmail setting an option in Triggers to "Stop task if it runs longer than" XX hours. This shall do.


67812be48ff92


You can use Task Scheduler to run Pmail setting an option in Triggers to &quot;Stop task if it runs longer than&quot; XX hours. This shall do. ![67812be48ff92](serve/attachment&amp;path=67812be48ff92)

-- Euler

Pegasus Mail 4.81.1154 Windows 7 Ultimate
IERenderer: 2.7.2.2 AttachMenu: 1.0.2.0
PMDebug: 2.5.8.37 BearHTML 4.9.9.6

edited Jan 10 at 2:17 pm

To simulate a virtual "close" you can use scripts created with scipt applications like AutoHotkey: It can send mouse clicks to any window you want so it could act like an invisible mouse.


To simulate a virtual &quot;close&quot; you can use scripts created with scipt applications like [AutoHotkey](https://www.autohotkey.com/): It can send mouse clicks to any window you want so it could act like an invisible mouse.
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C
edited Jan 10 at 4:45 pm

Here's the script I'm using:


PegasusMailClose:
{
Process, Exist, winpm-32.exe
PID = %Errorlevel%
if %PID%
{
DetectHiddenWindows, On
WinClose, Pegasus Mail ahk_pid %PID%
Process, WaitClose, %PID%, 10
DetectHiddenWindows, Off
}
Return
}
Here&#039;s the script I&#039;m using: ```` PegasusMailClose: { Process, Exist, winpm-32.exe PID = %Errorlevel% if %PID% { DetectHiddenWindows, On WinClose, Pegasus Mail ahk_pid %PID% Process, WaitClose, %PID%, 10 DetectHiddenWindows, Off } Return } ````
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C
edited Jan 10 at 5:16 pm
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft