Setting up scheduled task to run mbx

433 views
Skip to first unread message

Hank Finley

unread,
Jun 17, 2015, 8:24:10 PM6/17/15
to MapInfo-l
I have written an mbx for a client who needs to set it to run each day at a certain time.They are running Windows Server 2012.

When the schedule gets started it starts MapInfo Pro but then it doesn't run the script. Something about the Window opening when there is actually no desktop to run it on, kind of make sense...

What magic do I need to do to get this script to run?

--
Regards Hank

Hank Finley

unread,
Jun 18, 2015, 1:12:47 AM6/18/15
to MapInfo-l
Forgot to mention that this is converting tables from dbf style to native and committing to another location
--
Regards Hank

Hank Finley

unread,
Jun 18, 2015, 3:19:28 AM6/18/15
to MapInfo-l
Not getting any replies... Have I asked this the wrong way or is this not getting through?
--
Regards Hank

Uffe Kousgaard

unread,
Jun 18, 2015, 3:33:10 AM6/18/15
to mapi...@googlegroups.com
Wrong time of day.
At least here in Central Europe, you posted at 2am. Now it is 9.30am.

Maybe nobody is logged into windows when you start the script? Not sure how that would work.
If there is also no desktop, because it is a barebone configuration, it may not work at all.

Regards
Uffe

Hank Finley wrote:
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hank Finley

unread,
Jun 18, 2015, 3:40:18 AM6/18/15
to MapInfo-l
Thanks Uffe phew!
The task runs with Administrator credentials.
Maybe there is a way to set it up to run with MapInfo runtime or some server-side recognition? Not sure, I'll be patient and see if anyone else has done this before.
--
Regards Hank

Uffe Kousgaard

unread,
Jun 18, 2015, 3:44:51 AM6/18/15
to mapi...@googlegroups.com
Hi,

You may have more luck using ogr2ogr for the conversion. It is 100% command-line and should have no windows / desktop issues.

Bo Victor Thomsen

unread,
Jun 18, 2015, 3:49:05 AM6/18/15
to mapi...@googlegroups.com
Try to read this article: http://blogs.technet.com/b/askperf/archive/2015/02/18/help-my-scheduled-task-does-not-run.aspx (Especially the part about: “Run only when user is logged on”)
Microsoft changed the way in which scheduled task runs in Vista and later versions to make it more secure. That might be your problem.

Regards
Bo Victor Thomsen
AestasGIS
Denmark

Lars I. Nielsen (GisPro)

unread,
Jun 18, 2015, 4:24:49 AM6/18/15
to mapi...@googlegroups.com
Hi Hank,

We have a similar job, which did run, but crashed after a very specific amount of time.

I tracked it down to being about some internal GUI buffer overrun, most likely happening because there's no user context to dump it into.

I solved the problem by having the specific user (service) account always being logged onto the server (RDP + close the window).

This solved our issues, which is why the assumption I have has to do with GUI resources being amassed.

But dialog boxes are in any case a no-go, since they're all modal in MapBasic, so make sure none of those are popping up.


Best regards / Med venlig hilsen
Lars I. Nielsen
GIS & DB Integrator
GisPro

Tony Pilkington

unread,
Jun 18, 2015, 6:45:34 AM6/18/15
to mapi...@googlegroups.com
C:\"Program Files"\MapInfo\MB_Work\my_mbx.mbx -NOSPLASH –D  is the standard way of launching an mbx .
Note that "Program Files" has quotes around it as it contains a blank. Use quotes if your mbx name contains a blank.
 
You can insert in the mapbasic code to find the folder (use applicationdirectory$()) it is in, and thence to open a fixed name file for instructions or to write out a log file within that folder.
Ensure the mbx has no GUI interface, ie no buttons, dialogs or messages.

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4800 / Virus Database: 4311/10038 - Release Date: 06/17/15

Hank Finley

unread,
Jun 18, 2015, 7:34:59 AM6/18/15
to MapInfo-l

Thanks Tony I will try this once I get back in morning

Hank Finley

unread,
Jun 18, 2015, 8:39:17 AM6/18/15
to MapInfo-l
Hi Tony,

forgot to ask what -D stand for, and can I find this in help documentation somewhere?

The script has no dialogs, no Interactive on any statements and progressbars set off.

Kind regards
--
Regards Hank

CLS

unread,
Jun 23, 2015, 4:05:12 AM6/23/15
to mapi...@googlegroups.com
Hi Hank
Had the same problem after june 13. None of my mapinfo scheduled task would run unattended.
Found out that a Windows Update KB was guilty of the problem - after removing the KB everything was right again.
Reported it to Pitney Bowes denmark, and Peter Horsboll Moller has send it på Pitney Bowes Support
 
Here is what Peter wrote to PBS - and the name of the KB is also listed
 

Hi

 

Claus Sørensen, from the municipality of Viborg, has run into an issue when trying to run MapInfo Pro using a scheduled task on Windows Server.

It did work fine until recently.

Please keep Claus in the loop

 

After looking into the Windows patches, Claus figured out that a uninstalling a certain Windows Update from the server made MapInfo Pro run again.

He started removing KB3059317 but that didn’t help, but when he removed KB3057839 he was able to have MapInfo Pro run automatically again.

 

He can run MapInfo Pro manually when he’s logged into the server.

But when he tried to run MapInfo Pro using a time trigger he gets this error with MapInfo Pro 12.5.2 on Windows Server 2008R2 x64 and Windows Server 2012R2 x64:

Faulting application name: Mapinfow.exe, version: 12.5.0.206, time stamp: 0x54bd32f4

Faulting module name: micore.dll, version: 12.5.0.206, time stamp: 0x54bd3a73

Exception code: 0xc0000094

Fault offset: 0x000cdef3

Faulting process id: 0x930

Faulting application start time: 0x01d0a90b1cccf22f

Faulting application path: C:\Program Files (x86)\MapInfo125\Professional\Mapinfow.exe

Faulting module path: C:\Program Files (x86)\MapInfo125\Professional\micore.dll

Report Id: 5c852bcb-14fe-11e5-9480-001b784b3bc0

 

.Net

Application: Mapinfow.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: exception code c0000094, exception address 100CDEF3

Stack:

 

If he tries to run MapInfo Pro 12.0.3 or 11.0.4 on Windows Server 2008R2 x64 he gets this error:

Faulting application name: MapInfow.exe, version: 12.0.0.304, time stamp: 0x52a9ea4c

Faulting module name: KERNELBASE.dll, version: 6.1.7601.18869, time stamp: 0x556363bc

Exception code: 0xc0000094

Fault offset: 0x0000c42d

Faulting process id: 0xc14

Faulting application start time: 0x01d0a8e2dbc816db

Faulting application path: C:\Program Files (x86)\MapInfo\Professional\MapInfow.exe

Faulting module path: C:\Windows\syswow64\KERNELBASE.dll

Report Id: 1c24903d-14d6-11e5-a304-e4115b11a030

 

He only has this issue when running jobs using MapInfo Pro. Jobs with EasyLoader, file copy, Oracle SQL plus and more work fine.

 

Is this something we have come across before?
Do we have a workaround – other than uninstalling the Windows Update patch?

Michel de Ruiter

unread,
Aug 18, 2015, 6:48:42 AM8/18/15
to MapInfo-L
Thanks for sharing this!
When I uninstall the Windows update, MapInfo (run unattended) no longer crashes but hangs. Debugging showed it cannot validate our license (error 880002) which is otherwise working fine.
Any news on this subject? Workarounds, upcoming fixes?

Groente, Michel.

Op donderdag 18 juni 2015 02:24:10 UTC+2 schreef Hank Finley:

Michel de Ruiter

unread,
Oct 19, 2015, 6:02:42 PM10/19/15
to MapInfo-L
For the record: the license thing was a different issue, and the crash turned out to be an interaction with the Windows update which solved after another Windows Update. I guess MapInfo does something unexpected.

Groente, Michel.

Op dinsdag 18 augustus 2015 12:48:42 UTC+2 schreef Michel de Ruiter:
Reply all
Reply to author
Forward
0 new messages