Is it possible to pass TI Parameter variables to a dos batch file?
I can call a DOS batch file using the following:
ExecuteCommand('C:\test.cmd', 1);
and everything works fine. However, if I try to add parameters, the .cmd file won't run...
ExecuteCommand('C:\test.cmd p1 p2', 1);
any thoughts?
thanks!
Passing TI Parameters to a DOS .cmd file
- Mike Cowie
- Site Admin
- Posts: 482
- Joined: Sun May 11, 2008 7:07 pm
- OLAP Product: IBM TM1/PA, SSAS, and more
- Version: Anything thru 11.x
- Excel Version: 2003 - Office 365
- Location: Alabama, USA
- Contact:
Re: Passing TI Parameters to a DOS .cmd file
Hi,
Have you looked at the TI EXPAND function? It takes a string containing references to TI variables (which parameters are) and "expands" the contents of the variable into the string. So, using your example:
Here I'm assuming that you have 2 TI parameters (both String type) called p1 and p2.
As far as how it works, let's say you have the following values:
Hope that helps.
Regards,
Have you looked at the TI EXPAND function? It takes a string containing references to TI variables (which parameters are) and "expands" the contents of the variable into the string. So, using your example:
Code: Select all
ExecuteCommand(EXPAND( 'C:\test.cmd %p1% %p2%' ), 1);
As far as how it works, let's say you have the following values:
- p1=Hello
- p2=World
Code: Select all
ExecuteCommand('C:\test.cmd Hello World', 1);
Regards,
Mike Cowie
QueBIT Consulting, LLC
Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
QueBIT Consulting, LLC
Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
- kielmc
- Posts: 22
- Joined: Tue Jun 24, 2008 6:17 pm
- OLAP Product: TM1
- Version: 10.2.2 FP4
- Excel Version: 2013
- Location: Birmingham, AL
Re: Passing TI Parameters to a DOS .cmd file
Thanks Mike, that function is exactly what I'm looking for!