How to use RUN with ampersand character

60 views
Skip to first unread message

thia...@gmail.com

unread,
Sep 6, 2021, 6:13:37 AMSep 6
to Harbour Users
Hi,

I use the RUN command a lot to call external command line tools

Example (this works fine):

rcmd="c:\test programs\program.exe"
run &rcmd.

But I have a problem calling a command line tool when there is an ampersand in the path name :

Example (this does NOT work):

rcmd="c:\cli & tests\program.exe"
run &rcmd.

I get an error that "c:\cli" can not be foudnd because of the ampersand  ...

How can run a program with a full path that has a ampersand ("&" in it ??

Thank you in advance

KennyOoi

unread,
Sep 6, 2021, 10:15:18 AMSep 6
to Harbour Users
try this
rcmd="c:\cli & tests\program.exe"
hb_run( rcmd )


José M. C. Quintas

unread,
Sep 6, 2021, 10:32:46 AMSep 6
to harbou...@googlegroups.com
Do not use macro, when do not need it.

Sometimes macro is anything like recursive.

run ( "c:\cli & tests\program.exe" )


José M. C. Quintas
> --
Reply all
Reply to author
Forward
0 new messages