Page 1 of 1

Escaping charactrers in CSPro

Posted: November 1st, 2013, 4:14 pm
by kakinyim
I am trying to pass defaultPath variable to line 4 below.

1. errmsg("File Assigned = %d", setFile(instanceFile, concat(pathname(Temp),"instances.txt"),create ));
2. defaultPath = concat(pathname(Temp),"instances.txt");
3. errmsg(defaultPath);
4. errmsg("TaskList = %d", execsystem('cmd /k tasklist /fi "imagename eq csentry.exe" > '+defaultPath));

but am getting some error;
ERROR: Expecting right parenthesis ')' in a function call near line 7 in NASSEPV_LAUNCHAPP_FF procedure

I just know its because of the way am using defaultPath variable, how can use it'?

Lines 1, 2 and 3 are ok.

Re: Escaping charactrers in CSPro

Posted: November 4th, 2013, 5:10 pm
by Gregory Martin
You can't use the + operator to combine two strings. This is why you're getting the error on the fourth line. You can write:
errmsg("TaskList = %d", execsystem(concat('cmd /k tasklist /fi "imagename eq csentry.exe" > ',defaultPath)));

Re: Escaping charactrers in CSPro

Posted: November 5th, 2013, 7:16 am
by kakinyim
Gregory Martin wrote:You can't use the + operator to combine two strings. This is why you're getting the error on the fourth line. You can write:
errmsg("TaskList = %d", execsystem(concat('cmd /k tasklist /fi "imagename eq csentry.exe" > ',defaultPath)));

Thank you, it has worked.
Mutua

Re: Escaping charactrers in CSPro

Posted: February 14th, 2015, 1:07 am
by Sumerlove
Hi,

This is exceptionally decent and wonderful post.
I am very happy joined this forum.
I like it exceptionally much....!!!!


Thanks alot...