Page 1 of 1

ExecuteCommand Function in TI Unable to Run Batch File

Posted: Fri Sep 24, 2010 1:30 pm
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!

Re: ExecuteCommand Function in TI Unable to Run Batch File

Posted: Sun Sep 26, 2010 12:41 pm
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”.

Re: ExecuteCommand Function in TI Unable to Run Batch File

Posted: Mon Sep 27, 2010 7:44 pm
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);