Runtime module fail with SPACES even in quotes

Post comments and suggestions for RoboTask here
Post Reply
DK.Ideagen
Posts: 22
Joined: Wed Mar 09, 2022 10:33 pm

Runtime module fail with SPACES even in quotes

Post by DK.Ideagen »

Example
start "C:\Program Files\RoboTask\RoboTaskRuntime.exe" "C:\Users\daniel.kendall\Notepad.tsk"
works

Example
start "C:\Program Files\RoboTask\RoboTaskRuntime.exe" "C:\Users\daniel.kendall\OneDrive - Ideagen plc\Desktop\Notepad.tsk"
doesn't work and gets cut off at the first space.

This is despite wrapping it in quotes which normally solves this re:cli
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Runtime module fail with SPACES even in quotes

Post by Oleg »

Do you use the command START in CMD/batch file?
Oleg Yershov
DK.Ideagen
Posts: 22
Joined: Wed Mar 09, 2022 10:33 pm

Re: Runtime module fail with SPACES even in quotes

Post by DK.Ideagen »

That is how I would start a program from the CLI it wouldn't work otherwise (Illegal expression)

The bat files from robotask don't do that though and use a different executable e.g.
"C:\Program Files\RoboTask\RTaskRun.exe" $6CD53B88
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Runtime module fail with SPACES even in quotes

Post by Oleg »

The command line

Code: Select all

"C:\Program Files\RoboTask\RoboTaskRuntime.exe" "C:\Users\daniel.kendall\OneDrive - Ideagen plc\Desktop\Notepad.tsk"
should work

If you want to use command START you must use something like this:

Code: Select all

start "Single task" "C:\Program Files\RoboTask\RoboTaskRuntime.exe" "C:\Users\daniel.kendall\OneDrive - Ideagen plc\Desktop\Notepad.tsk"
1-st parameter in quotes after START command is the title.
StartCommand.png
StartCommand.png (19.24 KiB) Viewed 5111 times
If you use the program name in quotes (and parameters too) the title parameter is required
Oleg Yershov
DK.Ideagen
Posts: 22
Joined: Wed Mar 09, 2022 10:33 pm

Re: Runtime module fail with SPACES even in quotes

Post by DK.Ideagen »

In powershell specifically the behavior is different.

Start-Process: A positional parameter cannot be found that accepts argument 'C:\Users\daniel.kendall\OneDrive - Ideagen plc\Desktop\Notepad.tsk'.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Runtime module fail with SPACES even in quotes

Post by Oleg »

If you use PowerShell you have to use such command line

Code: Select all

start-process "C:\Program Files\RoboTask\RoboTaskRuntime.exe" "`"C:\Users\daniel.kendall\OneDrive - Ideagen plc\Desktop\Notepad.tsk`""
Pay attention to the symbol `

or such command line

Code: Select all

start-process -filepath "C:\Program Files\RoboTask\RoboTaskRuntime.exe" -ArgumentList "`"C:\Users\daniel.kendall\OneDrive - Ideagen plc\Desktop\Notepad.tsk`""
Read here about Start-Process cmdlet

I tested this on my computer
When I use such command line

Code: Select all

start-process "C:\Program Files\RoboTask\RoboTaskRuntime.exe" "C:\Users\olegyershov\OneDrive\Test task.tsk" 
I get the error:

Code: Select all

E: 14.11.2022 13:21:38: Task "C:\Users\olegyershov\OneDrive\Test" does not exist
If I use this

Code: Select all

start-process "C:\Program Files\RoboTask\RoboTaskRuntime.exe" "`"C:\Users\olegyershov\OneDrive\Test task.tsk`"" 
the task works without problem
Oleg Yershov
Post Reply