P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2017-06-01 16:23:56

oldgeek.work
Member
From: Iowa City, IA
Registered: 2017-06-01
Posts: 2
Website

Start program shortcut with parameters...

How do you add parameters to a shortcut to a program?

Offline

#2 2017-06-05 10:51:29

PIE Amber
Technical Software Developer
From: Williamston, MI
Registered: 2016-01-21
Posts: 196
Website

Re: Start program shortcut with parameters...

Hi,

This cannot be done through the normal interface, but it can be done in the script. Here's how:

Program the basic .exe to the Shortcut first.

Then go to Window > Script Code. Each key is a case statement. Button #1 is Case 1001, Button #2 is 1002, and so on.

For my Outlook, on Button #1, it looks like this:

                                Case 1001 'Button 001
                                                If State 'Pressed          [MWTAG10]
                                                                '<Shortcut[C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE]>
                                                                MW3.RunApp("C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE","")
                                                                '</Shortcut[C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE]>
                                                Else 'Released             [MWTAG11]
                                                End If 'Press-Release      [/MWTAG10/MWTAG11]

To insert a switch in you’d add it between the two quote marks on the middle line:

                                Case 1001 'Button 001
                                                If State 'Pressed          [MWTAG10]
                                                                '<Shortcut[C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE]>
                                                                MW3.RunApp("C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE","/select outlook:calendar")
                                                                '</Shortcut[C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE]>
                                                Else 'Released             [MWTAG11]
                                                End If 'Press-Release      [/MWTAG10/MWTAG11]

Click “Build” and you’re good to go.


Amber from P.I. Engineering

Offline

#3 2017-06-05 14:34:46

oldgeek.work
Member
From: Iowa City, IA
Registered: 2017-06-01
Posts: 2
Website

Re: Start program shortcut with parameters...

Thank you!

Offline

Board footer

Powered by FluxBB