Page 1 of 1

Turbo Integrator Functions - Create/Delete files/folders

Posted: Fri Jul 11, 2014 3:29 pm
by azara
Hi there,

I have to create a TI process that will create/delete files/folders.
Do you know what functions I can use?

For example, I have to create:
1. Create C:\a\b\test
2. Create C:\a\b\test\test.txt
3. Delete C:\a\b\test\

I understand that I can use ASCIIOUTPUT, TEXTOUTPUT..., but for each of them I have to define some variables.
How can I define that variables?
Is it another way to create files/folder?

Re: Turbo Integrator Functions - Create/Delete files/folders

Posted: Fri Jul 11, 2014 3:36 pm
by tomok
There are no Ti functions to create or delete folders. Only to create and delete files. What you need to do is create a batch file or WSH (Windows Scripting Host) file and then call that in TI through the ExecuteCommand function. There are plenty of examples on this forum if you'll take the time to search.

P.S. Just be cognizant that the ability to create and delete folders. or do anything else for that matter, is going to be subject to the security privileges of the account TM1 is running under, not your privileges.

Re: Turbo Integrator Functions - Create/Delete files/folders

Posted: Sat Jul 12, 2014 6:36 pm
by Wim Gielis
azara wrote:I understand that I can use ASCIIOUTPUT, TEXTOUTPUT..., but for each of them I have to define some variables.
How can I define that variables?
Euhm... did you read the Turbo Integrator guide? ... Have a look at other topics here... Did a Google search?... And so on.

Re: Turbo Integrator Functions - Create/Delete files/folders

Posted: Sun Jul 13, 2014 11:47 pm
by rmackenzie
azara wrote:I have to create a TI process that will create/delete files/folders.
Do you know what functions I can use?
Turbo Integrator has a pretty powerful command called ExecuteCommand which can be used to interact with the Windows command line interface. That interface has numerous commands to interact with the file system. E.g. to make and remove folders, your process could include:

Code: Select all

# folder names
sFolderName1 = '"d:\tm1\robin 1"';
sFolderName2 = '"d:\tm1\robin 2"';

# create folder 
sCommand = 'cmd /c "md ' | sFolderName1 | '"';
ExecuteCommand ( sCommand, 1 );

sCommand = 'cmd /c "md ' | sFolderName2 | '"';
ExecuteCommand ( sCommand, 1 );

# remove folder
sCommand = 'cmd /c "rd /s /q ' | sFolderName2 | '"';
ExecuteCommand ( sCommand, 1 );

Re: Turbo Integrator Functions - Create/Delete files/folders

Posted: Fri Jul 18, 2014 3:27 pm
by azara
Thanks!your answers really helped.