Running a Windows Task Schedule with spaces in the "Add

Posted by MBeynon on 16-Jan-2018 07:55


I have an OE 10.2B app that dynamically creates Windows tasks with the following properties;



Add arguments (optional);

  -basekey ini -ininame Tasks.ini -pf runTasks.p -p RunTasks.r -param '1'

Start in (optional);


The issue I'm having is with the escaping of the Add arguments which is preventing my Task from running. I've spent some time looking on the net at various ways of escaping this line but to no avail. Some people say use /c or double quotes or quote each set of items in the string but to no avail.

I could run a batch file I suppose from the Windows Task scheduler (which works) and pass the param argument to that if needed?



BTW, I'm using prowin32.exe as there are .NET components in my app!

All Replies

Posted by James Palmer on 16-Jan-2018 08:08

I think it should work if you add the whole thing to the Program/Script bit and enclose in double quotes, so in your example

"C:\OE102B\bin\prowin32.exe -basekey ini -ininame Tasks.ini -pf runTasks.p -p RunTasks.r -param '1'"

That's certainly how I've achieved similar in the past.

Posted by MBeynon on 16-Jan-2018 08:17

Cheers James. Tried this but Windows asks me what I want to run the .exe when the task runs!?

Posted by James Palmer on 16-Jan-2018 08:20

In which case, put the whole lot in the Program/Script section of a scheduled task manually, without the double quotes though, and hit ok. IIRC Windows asks you if you want to put the rest of the stuff in parameters. Select no. Then reopen the task and see how it's formatted now.

Posted by MBeynon on 16-Jan-2018 08:56

I'll try that.

Thanks again.

This thread is closed