Windows Scheduled Task running Automation plugin without user logged in

Windows Scheduled Task running Automation plugin without user logged in

Anonymous
Not applicable
1,229 Views
5 Replies
Message 1 of 6

Windows Scheduled Task running Automation plugin without user logged in

Anonymous
Not applicable

Hi,

 

I have setup a application that runs Navisworks using the Automation API.

 

It works well when run manually (user double click the .exe), and when executed by a scheduled task with the option 'run only when user is logged on'.

 

But when I try to set the scheduled task to run 'whether the user is logged on or not', the task fails when starting Navisworks: the Roamer.exe process appears in the task manager, but it shutdowns without having done anything after some 30 sec or so, and the application throws an error: "Failed to startup Navisworks: -2147024891"

 

The Navisworks application remains hidden, and the app has no call to the UI, be it any forms or dialogues.

The account I am using has all the required permission, and runs other scheduled task with this settings (that don't use Navisworks).

I have tried to run it with the licence borrowed and under different account as well.

 

Is there a limitation whereby Navisworks cannot run this way?

Anyone having experience running Navisworks Automation tasks in this way?

 

Nic

0 Likes
1,230 Views
5 Replies
Replies (5)
Message 2 of 6

ulski1
Collaborator
Collaborator

ngombault,

we have been running large scale roamer.exe production on servers for several years so there is nothing in Navisworks preventing this.

the most common error is that people forget to start roamer in nogui mode: 

roamer -NoGui -ExecuteAddInPlugin test.test.4324234-3432-4343-34343-3423423422 

 

 

and other issue is to do with the "local security policy" in windows.  Check that you that user account you are using have the right to "Log on as a batch job"

 

br

 

Ulrik

 

Message 3 of 6

Anonymous
Not applicable

Thanks mate,

 

Permissions are definitely set right as the Account I am using runs many other tasks and batches.

 

I think it is the -NoGui option. Any chance you'd know the trick to make this happen using the API?

 

The batch I am trying to run starts an executable that does several things, one of which is starting Navisworks using the Autodesk.Navsiworks.Automation simply using "New NavisworksApplication()", and there doesn't appear to be any overload or switch for NoGui.

 

Nic

0 Likes
Message 4 of 6

Anonymous
Not applicable

Your -NoGui suggestion solved the problem for the simple cases where I had only one plugin to call, so thanks for that.

I am still keen to find the equivalent using the API for when I am using the same Navisworks app to do multiple tasks.

 

Cheers,

Nic

0 Likes
Message 5 of 6

ulski1
Collaborator
Collaborator

I recommend that you create a new process with roamer.exe and set -nogui and plugin method as arguments to the process - I do not recommened using the "automation" stuff

0 Likes
Message 6 of 6

Anonymous
Not applicable

Thanks but unless I am missing something, by doing this I cannot call multiple plugins with the same process, and the time to start Navisworks open the file(s), save it after the plugin is ran, then close it and run and all of it for every plugin call becomes a big overhead.

 

I do use your recommended method for single plugin calls now, but I am still interested to know if there is a way to start Navisworks without gui using the automation api (or to run multiple plugins with your method). If not there should be.

0 Likes