infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
Alerts running programs
Rick Martin
Hi,
I'm trying to get a home-grown program (exe) to run as part of an alert, but it doesn't run. I have the Action set to:
exec {c:\dir\pgm.exe "parm1" "parm2" "parm3"}
But the program never appears to run. There is also a notify {} action ahead of this one, so I know the alert fires.
Do I have my syntax wrong?
Thanks! Rick
Find more posts tagged with
Clovertech
Comments
System
Originally posted by Doug Stelley
I Use:
Exec {cmd /c c:\hci\affinitycrash.vbs}
and it works...
System
Originally posted by Tom Henderson
The exec command requires a list, and you're giving it what amounts to a string. So it's trying to find and run a program named c:\dir\pgm.exe "parm1" "parm2" "parm3", when you want it to run a program named c:\dir\pgm.exe and pass in the parameters parm1, parm2, and parm3.
The other wrinkle is that it the list needs to be flattened, that is, at the same level as the exec command, not just contained in a variable. Otherwise, your program will see a single parameter rather than three separate parameters.
Fortunately, the fix is easy. The eval command will not only run any other TCL command, but also flatten out the list structure for you. Just issue the command like this:
eval exec c:\dir\pgm.exe "parm1" "parm2" "parm3"
Essentially, any time you want to construct a command programmatically, then execute it, just use the eval exec combo.
BTW, I generally find it easier to use single forward slashes rather than double the backslash. Of course, if you're passing a pathname to a native DOS/Windows command, you may not have any choice...
Rick Martin
Thanks all. Turns out it was a permissions problem. The hciuser didn't have the right permissions to run the program.
Next question. I see in the user guide (in an example) that I can use a %A for the message text. Is there a similar way to get the host and site information?
Thanks, Rick