Community Discussions and Support
MercuryX Task Scheduler will not recognise the end of a command's execution

I still use MercuryX to schedule collection of POP3 mail and sending SMTP mail via our ISP. We now have broadband, but still use a dial-up account when the broadband service is down. I run a batch file before starting and another batch file after stopping.

The 1st batch file contains the following line:
start "RASdial connect" /min /wait rasdial "<account-name>" <username> <password>

The 2nd batch file contains the following line:
start "RASdial disconnect" /min /wait rasdial "<account-name>" /disconnect

I've never experienced any problems with this method (OS: WinNT and Win2K).

I hope this is useful to you. Good Luck.

Stephen.

&lt;p&gt;I still use MercuryX to schedule collection of POP3 mail and sending SMTP mail via our ISP. We now have broadband, but still use a dial-up account when the broadband service is down.&amp;nbsp;I run a batch file before starting and another batch file after stopping.&lt;/p&gt;&lt;p&gt;The 1st batch file contains the following line: start &quot;RASdial connect&quot; /min /wait rasdial &quot;&amp;lt;account-name&amp;gt;&quot; &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;&lt;/p&gt;&lt;p&gt;The 2nd batch file contains the following line: start &quot;RASdial disconnect&quot; /min /wait rasdial &quot;&amp;lt;account-name&amp;gt;&quot; /disconnect&lt;/p&gt;&lt;p&gt;I&#039;ve never experienced any problems with this method (OS: WinNT and Win2K).&lt;/p&gt;&lt;p&gt;I hope this is useful to you. Good Luck.&lt;/p&gt;&lt;p&gt;Stephen.&lt;/p&gt;

I'm using Mercury 4.01b on a dial-up connection and schedule the connection via MercuryX Task Scheduler.  This is running on a Windows XP platform.

 

My problem is that MercuryX Task Scheduler will not recognise the end of a command's execution.


The command run 'before starting' and 'after stopping' is 'rasdial' with appropriate switches.  The checkbox "Wait until this process terminates before starting Mercury service processes" is checked.


Everything worked well until, for no apparent reason, the scheduler would make the connection via rasdial but would stay suspended 'waiting for the process to terminate'.  Rasdial would terminate after the successful connection, but this was not recognised by the Task Scheduler and as a result, Mercury never transacts any mail and the connection is never cleared down.


To get around the problem, a batch file was created and used as the command to run 'before starting'.  The batch file contained the rasdial command to establishing the dial-up connection.  Everything worked again - Mercury would see the batch file terminate and it would then transact the mail. At the end of the run the 'rasdial /disconnect' command cleared the dial-up connection.


Now again, for no apparent reason, Mercury will not recognise the end of the batch file and so will not transact any mail which in turn leaves the line permanently connected.  Reverting back to the original configuration does not help.  In fact configuring Mercury to start "Notepad.exe" results in notepad starting but when terminated, Mercury fails to recognise the termination and so waits indefinitely.  Bottom line is Mercury will not see the end of the command execution, irrespective of which command is used.


Can anyone shed any light on the matter - currently I'm working around the problem again by de-selecting "Wait until this process terminates before starting Mercury service processes" and using a 30 second delay before and after executing commands, but this is a poor solution.


Looking forward to some assistance . . Mervyn.
&lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt;I&#039;m using Mercury 4.01b on a dial-up connection and schedule the connection via MercuryX Task Scheduler.&amp;nbsp; This is running on a Windows XP platform.&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt; &lt;DIV align=left&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV align=left&gt;My problem is that MercuryX Task Scheduler&amp;nbsp;will not recognise&amp;nbsp;the end of a command&#039;s execution.&lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt;The command run &#039;before starting&#039; and &#039;after stopping&#039; is &#039;rasdial&#039; with appropriate switches.&amp;nbsp; The checkbox &quot;Wait until this process terminates before starting Mercury service processes&quot; is checked.&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt;Everything worked well until, for no apparent reason, the scheduler would make the connection via rasdial but would stay suspended &#039;waiting for the process to terminate&#039;.&amp;nbsp; Rasdial would terminate after the successful connection, but this was not recognised by the Task Scheduler and as a result, Mercury never transacts any mail and the connection is never cleared down.&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt;To get around the problem, a batch file was created and used as the command to run &#039;before starting&#039;.&amp;nbsp; The batch file contained the rasdial command to establishing the dial-up connection.&amp;nbsp; Everything worked again - Mercury would see the batch file terminate and it would then transact the mail. At the end of the run the &#039;rasdial /disconnect&#039; command cleared the dial-up connection.&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt;Now again, for no apparent reason, Mercury will not recognise the end of the batch file and so will not transact any mail which in turn leaves the line permanently connected.&amp;nbsp; Reverting back to the original configuration does not help.&amp;nbsp; In fact configuring Mercury to start &quot;Notepad.exe&quot; results in notepad starting but when terminated, Mercury fails to recognise the termination and so waits indefinitely.&amp;nbsp; Bottom line is Mercury will not see the end of the command execution, irrespective of which command is used.&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt;Can anyone shed any light on the matter - currently I&#039;m working around the problem again by de-selecting &quot;Wait until this process terminates before starting Mercury service processes&quot; and using a 30 second delay before and after executing commands, but this is a poor solution.&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style=&quot;FONT-SIZE: 10pt&quot;&gt;Looking forward to some assistance . . Mervyn.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;

I'm actually a little surprised to see that anyone is still using MercuryX... I thought in these days of (supposedly) ubiquitous, (supposedly) inexpensive broadband, there wouldn't be a need for it any more.

It's a couple of years since I've done any real testing on MercuryX - in fact, it's probably a couple of years since I've even looked at the code, if the truth be known. I'm not aware of any problems there, though - nothing has come up at any point on the formal support channels.

[ A couple of minutes later] I've just looked at the source, and it's pretty vanilla stuff - I call CreateProcess, get the handle for the process, then wait until the handle either becomes invalid or I get an exit code from the process. There's no possible point of failure in the logic, so if the process seems not to be terminating, it's because Windows is telling me that the process has not terminated.

The really telling part of your post is the comment that it *used to work*. Seventeen years of doing this has taught me to recognize statements like that as infallible indicators that something has changed in your system. The key is to work out what that "something" is. Did you install or update an application around that time? Change ISPs? Put in a new modem? Anything like that? Finding the change will usually give you an idea of where to look for the solution.

I'm not nearly naive enough to say that this definitely isn't a Mercury problem, but I would put it very low in the scale of possibilities. I'd strongly recommend that you spend some time looking over the rest of the system checking for changes.

Oh, and try rebooting the machine - you'd be amazed how often this just makes problems go away. *sigh*. Windows... *sigh*.

Cheers!

-- David --

 

&lt;p&gt;I&#039;m actually a little surprised to see that anyone is still using MercuryX... I thought in these days of (supposedly) ubiquitous, (supposedly) inexpensive broadband, there wouldn&#039;t be a need for it any more. It&#039;s a couple of years since I&#039;ve done any real testing on MercuryX - in fact, it&#039;s probably a couple of years since I&#039;ve even looked at the code, if the truth be known. I&#039;m not aware of any problems there, though - nothing has come up at any point on the formal support channels. [ A couple of minutes later] I&#039;ve just looked at the source, and it&#039;s pretty vanilla stuff - I call CreateProcess, get the handle for the process, then wait until the handle either becomes invalid or I get an exit code from the process. There&#039;s no possible point of failure in the logic, so if the process seems not to be terminating, it&#039;s because Windows is telling me that the process has not terminated. The really telling part of your post is the comment that it *used to work*. Seventeen years of doing this has taught me to recognize statements like that as infallible indicators that something has changed in your system. The key is to work out what that &quot;something&quot; is. Did you install or update an application around that time? Change ISPs? Put in a new modem? Anything like that? Finding the change will usually give you an idea of where to look for the solution. I&#039;m not nearly naive enough to say that this definitely isn&#039;t a Mercury problem, but I would put it very low in the scale of possibilities. I&#039;d strongly recommend that you spend some time looking over the rest of the system checking for changes. Oh, and try rebooting the machine - you&#039;d be amazed how often this just makes problems go away. *sigh*. Windows... *sigh*. Cheers! -- David -- &amp;nbsp;&lt;/p&gt;
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