I am trying to use the ExecuteCommand() function in TI to run a VB script with parameters but I'm currently having trouble getting it to run.
I have tried using both variables to construct the argument string and hardcoding an example for testing (see code below), neither of which worked.
The same string when entered directly on the command line works correctly. I have tested this with both my own account and logged into the TM1 server with the TM1 service account, both of which were fine. This made me think TM1 had all the permissions it needed but possibly not?
The script takes a few seconds to run and I have tried changing the wait argument on and off in TI and it makes no difference.
Is there anything else I should check in terms of permissions? Is there a way to debug this to see further information on where it is failing? Anything wrong with the string argument below?
Further information, which could be useful:
The VB script is opening a workbook and running a VBA macro on the TM1 server. The macro opens another workbook based on the date parameters provided and it transforms it ready for import into TM1 as a .csv. It saves the output on the TM1 server.
I'm running the TI from TM1 Perspectives 10.2.2 via a terminal services server.
Any help would be much appreciated,
Thanks
Code: Select all
########################################################################################
#Execute command to run VBScript with date parameters
########################################################################################
sFolderPath = '\\testTM1svr\tm1\Load Files\';
sFileName = 'RunConvertFiles.vbs';
sYear = '2016';
sMonth = '6';
sDay = '17';
#sArguments = 'CScript "' | sFolderPath | sFileName | '" "' | sDay | '" "' | sMonth | '" "' | sYear | '"';
sArguments = 'CScript "\\testTM1svr\tm1\Load Files\RunConvertFiles.vbs" "167 "6" "2016"';
AsciiOutput(sFolderPath | 'script arguments debug.txt',sArguments);
ExecuteCommand(sArguments, 1);