Escaping charactrers in CSPro

Other discussions about CSPro
Post Reply
kakinyim
Posts: 42
Joined: January 16th, 2012, 6:38 am
Location: Remote/Virtual

Escaping charactrers in CSPro

Post 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.
Gregory Martin
Posts: 1795
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Escaping charactrers in CSPro

Post 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)));
kakinyim
Posts: 42
Joined: January 16th, 2012, 6:38 am
Location: Remote/Virtual

Re: Escaping charactrers in CSPro

Post 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
Sumerlove
Posts: 1
Joined: February 14th, 2015, 1:05 am

Re: Escaping charactrers in CSPro

Post by Sumerlove »

Hi,

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


Thanks alot...
We offer up to date http://pass4sure.co.uk/ exam practice questions with self paced test engine to help you pass comptia network+ exam and complete your ccent course kumc you should also find ccnp wireless training for your Northwestern University
Post Reply