PxPlus User Forum

Main Board => Discussions => Language => Topic started by: michaelgreer on June 17, 2021, 09:46:19 AM

Title: *windev* and scheduled tasks
Post by: michaelgreer on June 17, 2021, 09:46:19 AM
We have a user trying to run a program via the Task Scheduler on windows and a printer open to a *windev* device is throwing an error 12.  Is there a limitation on using *windev* when running something in this fashion?
Title: Re: *windev* and scheduled tasks
Post by: Stéphane Devouard on June 17, 2021, 10:52:06 AM
Michael


When running, the scheduled task will have the credentials of the user account you have set up for the task
If you use something like LocalSystem, then be aware that this user does not have any network access, which may explain the error 12 if your *windev* points to a shared printer device.


HTH
Regards,
Title: Re: *windev* and scheduled tasks
Post by: michaelgreer on June 17, 2021, 10:57:10 AM
Thanks Stephan!  I am running as administrator with highest permissions.  The spooler *is* however configured for a shared pritner.
Title: Re: *windev* and scheduled tasks
Post by: Stéphane Devouard on June 17, 2021, 11:13:54 AM
Then you should try to open a session as administrator account, run a ProvideX prompt, and try to open the *windev* device
If it yields an error 12, then it will yield the same error when running as a scheduled task


You may need to manually mount the shared printer / queue in your program with something like


Code: [Select]
invoke "net use ..."

HTH
Title: Re: *windev* and scheduled tasks
Post by: michaelgreer on June 17, 2021, 02:57:24 PM
Stephan,

Even though the scheduled task was set to run as administrator, it was not set up by user administrator. When we deleted it and re-added under the administrator login all was good, so you were pointing in the right direction.

Thanks!