is it possible to run an ArcObjects add-in as a Windows scheduled task?

4603
2
Jump to solution
01-18-2016 09:26 AM
AndreaLugli
New Contributor

I am writing because I am wondering if it is possible to run an ArcObjects .NET add-in as a Windows scheduled task.

I have written some code in VB.NET through ArcObjects and then I prepared the add-in using Visual Studio.

It works fine in ArcGIS desktop but now I need to run it automatically every night as a scheduled task.

I know that it is possible for Python scripts ... maybe wrapping the .NET add-in inside a Python script?

Andrea Lugli (Italy)

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
FreddieGibson
Occasional Contributor III

Technically yes...but it would make more sense to migrate your logic to a construct that would be easier to run headlessly, like a standalone console application (i.e. exe) or gp service. If you must run the logic as an addin then you'd need to write an additional application to automate driving a session of ArcMap so that you can get a hook into your addin content and interact with it as needed.

The following two pages would get you started.

Automating the ArcGIS Desktop Application

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Automating_the_ArcGIS_Desktop_ap...

How to create an application to run on a schedule

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000002nt000000

View solution in original post

2 Replies
ChrisSmith7
Frequent Contributor

If it's an exe, I would check out Schedule a task - Windows Help

Keep in mind some pitfalls others have encountered:

ArcObjects fail when running scheduled task

FreddieGibson
Occasional Contributor III

Technically yes...but it would make more sense to migrate your logic to a construct that would be easier to run headlessly, like a standalone console application (i.e. exe) or gp service. If you must run the logic as an addin then you'd need to write an additional application to automate driving a session of ArcMap so that you can get a hook into your addin content and interact with it as needed.

The following two pages would get you started.

Automating the ArcGIS Desktop Application

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Automating_the_ArcGIS_Desktop_ap...

How to create an application to run on a schedule

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000002nt000000