Canada
Asked — Edited
Resolved Resolved by ptp!

Missing ) In Expression When Using Exec In Script

Exec("C:\Program Files (x86)\RoboRealm\RoboRealm.exe")

generates an error : missing ")" in expression.

I suppose the (x86) within the command generate the problem.

Any suggestion to work around this problem?

User-inserted image


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

#1  

The issue is with the (x86) in the command. I built a link and call that link instead of the direct exe. The link would point to the exe. The link is stored in a directory that is simple like "C:\DirectoryWithoutSpacesOrSpecialCharacters".

just a work around and someone else may have a solution.

PRO
USA
#2  

can you try the following:

1)


Exec("""C:\Program Files (x86)\RoboRealm\RoboRealm.exe""") 

or

2)


Exec("\"C:\Program Files (x86)\RoboRealm\RoboRealm.exe\"")

#3  

I have tried using escape characters and haven't gotten it to work. I dont know that I tried those sequences though.

PRO
USA
#4  

is a guess,

it will depend first how the EZB engine parses and handle escape characters (if it supports)

secondly it depends how the shell command is executed, i'm guessing the string is being passed directly to the shell versus a detailed call (working directory, program path, arguments)

PRO
USA
#5  

try this:


Exec("C:\progra~2\RoboRealm\RoboRealm.exe") 

basically you replaced the long name with a DOS (yes before windows) path name (8 characters):

to obtain DOS PATHs run:

dir /x

in the parent directory for each sub-directory.

cheers

Canada
#6  

The last command did work.

Exec("C:\progra~2\RoboRealm\RoboRealm.exe")

Tanks to you both

#7  

Glad you got it working. I think you can also call the roborealm file directly if you are using multiple of them. It has been so long since I did this but it is either possible to call the robo file directly or pass it in as a parameter. I cant remember which.

PRO
USA
#8  

did both options generated errors in EZB ?

I had faith that the first option could work too..