.NET & Compiled Exes

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rguez_18
Newbie
Posts: 4
Joined: Fri Jun 06, 2014 4:26 am

.NET & Compiled Exes

Post by rguez_18 » Fri Jun 06, 2014 4:30 am

Anyone has experience calling compiled exes and passing variables to it from C#.NET? I'm trying to automate a tool but need to pass variable to the compiled script from my .NET desktop app. Any help/hint is greatly appreciated. Thanks!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: .NET & Compiled Exes

Post by Marcus Tettmar » Fri Jun 06, 2014 6:53 am

To pass variables just use exename.exe /variablename=value etc. Shell the exe the same way you would any other. E.g.: http://stackoverflow.com/questions/1567 ... to-be-done


Sent from my iPad using Tapatalk
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rguez_18
Newbie
Posts: 4
Joined: Fri Jun 06, 2014 4:26 am

Re: .NET & Compiled Exes

Post by rguez_18 » Sat Jun 07, 2014 5:53 pm

Hi Marcus,
Thanks for your reply, another question though, when you create a variable on your script does it automatically become a parameter when you compile the script into exe? Or is there anything else needed before you can use it as a parameter. Thanks!

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: .NET & Compiled Exes

Post by JRL » Sat Jun 07, 2014 10:38 pm

1) Create a script named display_text.scp and put in one line.

Code: Select all

MDL>strText
2) Compile display_text.scp

3) Run display_text.exe with /strText= as the parameter and whatever text you add will be displayed.
display_text /strText="Hello World"

You should see a Macro Scheduler message that contains Hello World.
Basically the parameter is automatically a variable in the script.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts