Page 1 of 1
Not a valid win 32 application
Posted: Wed Aug 19, 2009 3:17 am
by telula
Hello,
I have this in the epilog of a process
NumericGlobalVariable('ProcessReturnCode');
If(ProcessReturnCode=ProcessExitNormal());
ExecuteCommand('D:\ErrorEmail2.vbs',1);
Endif;
And I get a "Error: Epilog procedure line (17): %1 is not a valid Win32 application." in the message log.
The vbs file works in the command prompt but not as part of TI.
Anyone knows the solution?
Re: Not a valid win 32 application
Posted: Wed Aug 19, 2009 4:25 am
by lotsaram
My guess would be that in the ExecuteCommand function you need to pass the parameter to your vb script as a string not a value.
... but also, if the process exits normally without errors why would you want to send an email notification, surely you would want to do this only in the event of a process error log being generated?
Re: Not a valid win 32 application
Posted: Wed Aug 19, 2009 5:15 am
by kangkc
No no no...
This is not the right way to call VBScript from TI.
ExecuteCommand will need to call a exe or a cmd, bat file. It can't execute a VBS directly.
Do this instead to execute VBS:
ExecuteCommand('C:\windows\system32\cscript.exe D:\ErrorEmail2.vbs',1);
Re: Not a valid win 32 application
Posted: Wed Aug 19, 2009 5:30 am
by telula
Hello,
To answer lotsaram, I used ProcessExitNormal() just to make sure the email section gets called so I can test if the email gets sent out.
I changed my code as suggested by kangkc and it worked!! thanks all....
Re: Not a valid win 32 application
Posted: Wed Aug 19, 2009 7:41 am
by Steve Vincent

Hi Telula, would you mind sharing the vbs code too? not sure i can use automated email here but would be interesting to see how you are calling it, thanks
Re: Not a valid win 32 application
Posted: Wed Aug 19, 2009 11:01 am
by Jbcroft53
You've got to call the vbs using the command shell like kangkc said.
Re: Not a valid win 32 application
Posted: Wed Aug 19, 2009 12:57 pm
by Lukas Meyer
I think Steve refers to how to call the sending of the email - like in
http://www.bihints.com/send_email_attachments
(If Steve doesn't refer to how to make the mailing happen the link might be useful for someone who stumbles on this post via search

)
And kangkc might be the kc_kang credited at above mentioned link, that would explain why he knows how to get vbs-scripts running...
Oh - and because bihints tends to be unreachable exactly the moment you need it most - I attached the send-script. (And because I may not upload txt,vbs or invalid jpg I renamed it to zip, which it is - obvioously - not. rename to txt, vbs or any extension you associate with an editor capable of opening plain text format, which should be virtually anyone not limited to wysiwyg)
To quote the credits: "code from kc_kang (applix forum) and
http://www.rondebruin.nl/cdo.htm"
PS.: it is definitely too hot here...
Re: Not a valid win 32 application
Posted: Thu Aug 20, 2009 2:53 am
by kangkc
SKIPCHECK;;
['kangkc']=['kc_kang'];
FEEDERS;
['kc_kang'] => ['kangkc']
I used a fair bit of ExecuteCommand in my consultancy work involving TM1, and there are many possibilities in process automation. TI is a very dynamic and yet simple ETL tool.
Re: Not a valid win 32 application
Posted: Fri Aug 21, 2009 7:08 am
by Lukas Meyer
kangkc wrote:SKIPCHECK;
['kangkc']=['kc_kang'];
FEEDERS;
['kc_kang'] => ['kangkc'];
In your case I would have created an alias - I really hate having hundreds of elements mirroring each other using rules

(So I could never work at government agency where one might be able to change his or her name (honestly, I have no clue how to call the place - not even in my language. But it doesn't matter) - "I'm sorry, I'm from the TM1-side, so you want to see someone from SAP; they can change your name, I can only offer you an alias")
Re: Not a valid win 32 application
Posted: Fri Aug 21, 2009 7:54 am
by Alan Kirk
Lukas Meyer wrote:kangkc wrote:SKIPCHECK;
['kangkc']=['kc_kang'];
FEEDERS;
['kc_kang'] => ['kangkc'];
In your case I would have created an alias - I really hate having hundreds of elements mirroring each other using rules

(So I could never work at government agency where one might be able to change his or her name (honestly, I have no clue how to call the place - not even in my language. But it doesn't matter)
If I had to guess (about both the language and the name) it would be "Standesamt" or in English, "Registry Office".
(Or, in my own case if I revert to my former Applix Forums persona, "the Project Treadstone office at CIA Langley". Although of course I don't remember any of that...)
Lukas Meyer wrote:
- "I'm sorry, I'm from the TM1-side, so you want to see someone from SAP; they can change your name, I can only offer you an alias")
No, it
is possible to change a name in TM1... as long as you don't mind going via the old version 6, pre-alias method of exporting their personality into a text file, deleting their name, entering the new one into their ID dimension, recompiling the dimension and re-importing their personality.
Might take a while, though.
(For the technically pedantic, yes, I know that you're really deleting the old element and creating a new one rather than "renaming" the original, but in version 6 it was as close as you got to it...)
Re: Not a valid win 32 application
Posted: Fri Aug 21, 2009 8:30 am
by Lukas Meyer
Alan Kirk wrote:
If I had to guess (about both the language and the name) it would be "Standesamt" or in English, "Registry Office".
Maybe in Germany/Switzerland, in Austria "Standesamt" is only for marriage, birth registration and death registration. You could change your name at the same building you get your pass from, tough you would need to run around for ages in this building to find what you are looking for (if the ibm-page is a maze, those governmental bureaus are a maze where lots of people give you different directions, depending on how many forms you completed. At least this seems to be the same all over the world...)
Alan Kirk wrote:
No, it is possible to change a name in TM1... as long as you don't mind going via the old version 6, pre-alias method of exporting their personality into a text file, deleting their name, entering the new one into their ID dimension, recompiling the dimension and re-importing their personality.
[...]
(For the technically pedantic, yes, I know that you're really deleting the old element and creating a new one rather than "renaming" the original, but in version 6 it was as close as you got to it...)
So in version 6 there were no personalized folders for private items? I really like this step

(and I really love it when some user thinks "oh, a funny looking subset with an insane amount of numbers in its name - looks like some process created it and failed to delete it... I'm going to take it in a private view. Yes, that's a fine idea" - then its folder-fun again

)
I think technically pedantic people don't like the idea of renaming at at - makes just problems. Aliases are nice, especially if you have them depending on time. Those crazy SAP-guys have even structures depending on time. It's not fair, they have shiny, fun toys and all we get here are sticks,rocks and bugs to play with

Re: Not a valid win 32 application
Posted: Fri Aug 21, 2009 8:33 am
by kangkc
Lukas Meyer wrote:kangkc wrote:SKIPCHECK;
['kangkc']=['kc_kang'];
FEEDERS;
['kc_kang'] => ['kangkc'];
In your case I would have created an alias - I really hate having hundreds of elements mirroring each other using rules

(So I could never work at government agency where one might be able to change his or her name (honestly, I have no clue how to call the place - not even in my language. But it doesn't matter) - "I'm sorry, I'm from the TM1-side, so you want to see someone from SAP; they can change your name, I can only offer you an alias")
Hey guys, this is meant to clarify my identity on the old Applix forum, not a real TM1 rule. /lol
I'm sorry if I confused anyone...

Re: Not a valid win 32 application
Posted: Fri Aug 21, 2009 8:45 am
by Lukas Meyer
kangkc wrote:Hey guys, this is meant to clarify my identity on the old Applix forum, not a real TM1 rule. /lol
I'm sorry if I confused anyone...

As you wrote it, it wouldn't have worked anyways...
If I were sorry whenever I confuse someone, I would not be able to feel sorry anymore - so better be sorry when you crash a TM1 server at the peak-usage time, or when you are unable to give advice other than "restart your TM1 server"...
Re: Not a valid win 32 application
Posted: Fri Sep 21, 2012 11:15 am
by AmbPin
kangkc wrote:
ExecuteCommand('C:\windows\system32\cscript.exe D:\ErrorEmail2.vbs',1);
Hello found this post really useful, might be worth noting that if either of the paths above contain spaces you need to put both in quotes so might be best practice to do that by default, E.g.
Code: Select all
ExecuteCommand('"C:\windows\system32\cscript.exe" "D:\ErrorEmail2.vbs"',1);