ExecuteCommand Function in TI Unable to Run Batch File

Post Reply
kali
Posts: 4
Joined: Tue Aug 17, 2010 7:47 pm
OLAP Product: TM1
Version: 9.4.1
Excel Version: 2003

ExecuteCommand Function in TI Unable to Run Batch File

Post by kali »

Hi All,

I am trying to execute a batch file in TI using the “ExecuteCommand” function.

ExecuteCommand('RenameFile.bat',0);

When I run the batch file manually it works fine.

The problem is when I run the batch file using the “ExecuteCommand” function. The TI process returns a “Process completed successfully” message, but it doesn’t do anything.
I know that the function can access the file, because it returns an error whenever I change the file name that I pass in.

I am using an administrator account to logon to Architect and the TM1 services are running as “Local System Account”.

I have also tried to allow “Full Control” privilege to the batch file, but this did not fix the issue.

Does anyone know why this is happening?

Thanks!
jrizk
Posts: 48
Joined: Thu Nov 19, 2009 10:38 pm
OLAP Product: Tm1
Version: 10.2.2
Excel Version: 2010

Re: ExecuteCommand Function in TI Unable to Run Batch File

Post by jrizk »

Maybe the file your are trying to rename is locked when the ExecuteCommand is being run - the TI process would still return “Process completed successfully”.
J.Rizk
Tm1 for everyone
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: ExecuteCommand Function in TI Unable to Run Batch File

Post by tomok »

If you want to run a batch file from a TI process you have to open a command window (with a parameter set to automatically close the window upon completion) first and then run the batch file. It would look something like this:

CommandLine ='cmd /c RenameFile.bat';
ExecuteCommand(CommandLine, 0);
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Post Reply