PxPlus User Forum

Twitter Twitter Twitter

Author Topic: *windev* and scheduled tasks  (Read 163 times)

michaelgreer

  • Gold Member
  • ****
  • Posts: 71
    • View Profile
*windev* and scheduled tasks
« 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?

Stéphane Devouard

  • Gold Member
  • ****
  • Posts: 64
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: *windev* and scheduled tasks
« Reply #1 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,
Stéphane Devouard
Portfolio | Work

michaelgreer

  • Gold Member
  • ****
  • Posts: 71
    • View Profile
Re: *windev* and scheduled tasks
« Reply #2 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.

Stéphane Devouard

  • Gold Member
  • ****
  • Posts: 64
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: *windev* and scheduled tasks
« Reply #3 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
Stéphane Devouard
Portfolio | Work

michaelgreer

  • Gold Member
  • ****
  • Posts: 71
    • View Profile
Re: *windev* and scheduled tasks
« Reply #4 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!