Page 1 of 1

Calling VBscripts issues - not permissions related

Posted: Thu Jul 02, 2015 2:29 pm
by winshent
Hi Guys

I am new to this forum and have recently started working with TM1.

I have written a vbscript which copies each TM1 file in our data directory to a backup folder, zipping each file. It creates Backup Folders named Day0 through to Day6. If the folder for the current day exists then the folder is deleted and recreated, ready for new zipped files to be added.

This works fine when clicking on it as a user. I have also tested on my C drive, running this with a copy of all live files. These zip down to 1.7Gb, with around 2,000 zip files being added to the backup folder.

When calling from a TI process it seems to hang if I run it manually. When running it as a chore it executes succefully in the TM1 server log but nothing actually happens.

To test permissions etc in the same directory, I have created another script which deletes a test folder (which has a couple of test files). The script also creates a text file with a timestamp in the same folder. This work when executing manually by clicking on the script. It also runs fine when connecting up the same TI process (changed name of script called) and scheduling from the chore.

It appears permissions are not an issue, so I'm a bit confused...

Any ideas ?

Re: Calling VBscripts issues - not permissions related

Posted: Thu Jul 02, 2015 3:36 pm
by tomok
winshent wrote:It appears permissions are not an issue, so I'm a bit confused...Any ideas ?
How have you come to this conclusion? TI processes run under the account that the TM1 service runs under, not yours. Did you log into the server using this account and then click on the script to see if it would execute?

Re: Calling VBscripts issues - not permissions related

Posted: Fri Jul 03, 2015 8:36 am
by winshent
tomok wrote:
winshent wrote:It appears permissions are not an issue, so I'm a bit confused...Any ideas ?
How have you come to this conclusion? TI processes run under the account that the TM1 service runs under, not yours. Did you log into the server using this account and then click on the script to see if it would execute?
Hi Tomok

No i logged on to the server with an admin account.

However, the 'test' script runs successfully when run as a scheduled chore, and this in my mind does pretty much the same thing as my 'zipping' script... ie it deletes a folder and its contents, and can create a new folder and files.

In the TI process I only changed the name of the vbscript. Both scripts are in the same location.

Re: Calling VBscripts issues - not permissions related

Posted: Fri Jul 03, 2015 9:53 am
by gtonkin
Please post the ExecuteCommand lines from both processes so that we can get an idea of syntax, filenames, invalid characters etc.

Re: Calling VBscripts issues - not permissions related

Posted: Fri Jul 03, 2015 11:15 am
by winshent
gtonkin wrote:Please post the ExecuteCommand lines from both processes so that we can get an idea of syntax, filenames, invalid characters etc.
Hi.. here they are...

Code: Select all

ExecuteCommand('C:\windows\system32\cscript.exe E:\Tm1dev9\Backup\TestScript.vbs' ,0);

Code: Select all

ExecuteCommand('C:\windows\system32\cscript.exe E:\Tm1dev9\Backup\BackupToZip.vbs' ,0);

Re: Calling VBscripts issues - not permissions related

Posted: Fri Jul 03, 2015 11:31 am
by gtonkin
Ok, so they both look fine.
Have you tried outputting a string to a text file as your first command in the .VBS to see that the process is actually starting?

Re: Calling VBscripts issues - not permissions related

Posted: Fri Jul 03, 2015 2:08 pm
by winshent
gtonkin wrote:Ok, so they both look fine.
Have you tried outputting a string to a text file as your first command in the .VBS to see that the process is actually starting?
Yes I have tested this... I am going to test if i can xcopy a single file from the source folder.. To see if there is a permissions issue there..

Re: Calling VBscripts issues - not permissions related

Posted: Fri Jul 03, 2015 2:19 pm
by winshent
Just added fso.copyFile to my test script and that works fine when called via the chore/ ti processes..