Executing temporary bat files using TI

Ideas and tips for enhancing your TM1 application
Post Reply
Wim Gielis
Posts: 1824
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium

Executing temporary bat files using TI

Post by Wim Gielis » Sat Oct 03, 2009 1:20 pm


I thought I would post up a simple example in a TI process to generate a batch file, execute it, and kill it.

The process creates the file usernames.bat in the folder C:\BV. After that, it executes the bat file and kills it again. As a result, the username in Windows is appended to the file C:\TM1\usernames.txt

Steps to reproduce:

Create a new process

In the Prolog tab:

Code: Select all

# 0. preliminary

# 1. create the temporary bat file
ASCIIOUTPUT(vTempFileName,'cd "C:\TM1"');
ASCIIOUTPUT(vTempFileName,'echo %username% >> usernames.txt');
In the Epilog tab:

Code: Select all

# 2. execute the file

# 3. kill the temporary bat file again
Feel free to extend the approach taken, by making the bat file more "interesting". For instance, using the Metadata and Data tabs you could setup more difficult situations.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

Post Reply