Not a valid win 32 application

Post Reply
telula
Posts: 99
Joined: Tue Nov 18, 2008 5:40 am

Not a valid win 32 application

Post 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?
lotsaram
MVP
Posts: 3701
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Not a valid win 32 application

Post 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?
kangkc
Community Contributor
Posts: 206
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1, PA , TMVGate
Version: 2.x
Excel Version: 36x
Location: Singapore
Contact:

Re: Not a valid win 32 application

Post 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);
telula
Posts: 99
Joined: Tue Nov 18, 2008 5:40 am

Re: Not a valid win 32 application

Post 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....
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: Not a valid win 32 application

Post by Steve Vincent »

:D 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
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Jbcroft53
Posts: 1
Joined: Mon Jan 12, 2009 3:15 am

Re: Not a valid win 32 application

Post by Jbcroft53 »

You've got to call the vbs using the command shell like kangkc said.
Lukas Meyer
Posts: 51
Joined: Thu Jul 24, 2008 6:14 am

Re: Not a valid win 32 application

Post 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...
Attachments
SendMail.vbs.not.a.zip
http://www.bihints.com/send_email_attachments :
"code from kc_kang (applix forum) and http://www.rondebruin.nl/cdo.htm"
(891 Bytes) Downloaded 742 times
kangkc
Community Contributor
Posts: 206
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1, PA , TMVGate
Version: 2.x
Excel Version: 36x
Location: Singapore
Contact:

Re: Not a valid win 32 application

Post by kangkc »

SKIPCHECK;;
['kangkc']=['kc_kang'];

FEEDERS;
['kc_kang'] => ['kangkc']


:lol:

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.
Lukas Meyer
Posts: 51
Joined: Thu Jul 24, 2008 6:14 am

Re: Not a valid win 32 application

Post 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")
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Not a valid win 32 application

Post 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...)
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Lukas Meyer
Posts: 51
Joined: Thu Jul 24, 2008 6:14 am

Re: Not a valid win 32 application

Post 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 :(
kangkc
Community Contributor
Posts: 206
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1, PA , TMVGate
Version: 2.x
Excel Version: 36x
Location: Singapore
Contact:

Re: Not a valid win 32 application

Post 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... :lol:
Lukas Meyer
Posts: 51
Joined: Thu Jul 24, 2008 6:14 am

Re: Not a valid win 32 application

Post 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... :lol:
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"...
AmbPin
Regular Participant
Posts: 173
Joined: Sat Mar 20, 2010 3:03 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2007-10

Re: Not a valid win 32 application

Post 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);
Post Reply