Execute Program Parameters

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Execute Program Parameters

Post by KnightWare »

Any way to EXECUTE PROGRAM from a process and pass parameters? Want to launch a batch (CMD) file and pass parameters from BO. Also, does the Execute Program understand UNC file paths?
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: Execute Program Parameters

Post by BobK »

I have used something like the following:

Code: Select all

EXECUTE PROGRAM 'C:\FullPath\commandFile.cmd '+BO.attr1+' '+BO.attr2
Inside the command file the parameters are referenced as %1 and %2
Bob
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Re: Execute Program Parameters

Post by KnightWare »

Anything I put after 'C:\FullPath\commandFile.cmd ' results in syntax error for action'
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Re: Execute Program Parameters

Post by KnightWare »

Actually its the double quotes. I need to surround the BO's with double-quotes,
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Re: Execute Program Parameters

Post by KnightWare »

I found by setting a System Settings attribute to a quote, you can concatenate on the Action Line.

SystemSetting.DQ = "

Action 1 =
EXECUTE PROGRAM '\\Server\Folder\Batch.CMD' + SystemSettings.DQ + BO.Attribute1 + SystemSettings.DQ
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Execute Program Parameters

Post by Jaymer »

Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply