PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Mike Hatfield on February 17, 2019, 03:01:46 AM

Title: Starting pxplus in Windows Task Scheduler
Post by: Mike Hatfield 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

Title: Re: Starting pxplus in Windows Task Scheduler
Post by: Dave Fullerton 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
Title: Re: Starting pxplus in Windows Task Scheduler
Post by: Mike Hatfield 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.

Title: Re: Starting pxplus in Windows Task Scheduler
Post by: Dave Fullerton 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
Title: Re: Starting pxplus in Windows Task Scheduler
Post by: Mike Hatfield on February 17, 2019, 04:18:54 PM
Hi Dave,

Removing the quotes worked.
Obvious solution really  :(
Thanks
Title: Re: Starting pxplus in Windows Task Scheduler
Post by: Dave Fullerton on February 18, 2019, 04:50:27 AM
Hi Mike:

Ain't hindsight wonderful ;)

Glad to have helped in a small way.

Dave