PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Starting pxplus in Windows Task Scheduler  (Read 1821 times)

Mike Hatfield

  • Gold Member
  • ****
  • Posts: 70
    • View Profile
Starting pxplus in Windows Task Scheduler
« on: February 17, 2019, 03:01:46 AM »
I have a windows task setup to start a background instance of pxplus.exe
This task starts and runs as expected.

Task Editor:
In the Edit Action I have
Start a program
Program/Script F:\HIT\PVX\pxplus.exe

Add arguments  -BKG "f:\hit\prog\pp\ppemailformbg"

The task runs at startup and ppemailformbg runs OK.

I want to add some pxplus arguments the same as I would with the properties in a WindX shortcut

EG  -BKG "f:\hit\prog\pp\ppemailformbg -arg HI 17"

The whole Action line looks like F:\HIT\PVX\pxplus.exe -BKG "f:\hit\prog\pp\ppemailformbg -arg HI 17"

Now the task fails to start my program
So, the question is - How do I add the startup arguments when using the task scheduler?
This is Windows Server 2016

Mike H

Dave Fullerton

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Starting pxplus in Windows Task Scheduler
« Reply #1 on: February 17, 2019, 04:59:24 AM »
Hi Mike:

I hope you're doing well.

When you say "The task starts to fail", what, do you mean?  Is there an error that occurs?  Does logic you expect to happen because arg(1)="HI" dpesn't happen? 

Just as a thought, are you able to dump the arguments to a text file, which would then be read in "formbg" when it starts up?

Regards

Dave Fullerton

Mike Hatfield

  • Gold Member
  • ****
  • Posts: 70
    • View Profile
Re: Starting pxplus in Windows Task Scheduler
« Reply #2 on: February 17, 2019, 06:31:05 AM »
Hi Dave
I can see an instance of pxplus in task manager but my program doesn't run at all.
It's like the windows task parser doesn't like the -arg part of the task or its not passing it to pxplus.
There are no errors in the task manager or event viewer.

Mike H

Dave Fullerton

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Starting pxplus in Windows Task Scheduler
« Reply #3 on: February 17, 2019, 09:24:33 AM »
Hi Mike:

So what happens if you remove the quotes?  Something like

F:\HIT\PVX\pxplus.exe -BKG f:\hit\prog\pp\ppemailformbg -arg HI 17

Dave

Mike Hatfield

  • Gold Member
  • ****
  • Posts: 70
    • View Profile
Re: Starting pxplus in Windows Task Scheduler
« Reply #4 on: February 17, 2019, 04:18:54 PM »
Hi Dave,

Removing the quotes worked.
Obvious solution really  :(
Thanks
Mike H

Dave Fullerton

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Starting pxplus in Windows Task Scheduler
« Reply #5 on: February 18, 2019, 04:50:27 AM »
Hi Mike:

Ain't hindsight wonderful ;)

Glad to have helped in a small way.

Dave