Announcement

Collapse
No announcement yet.

Script to open a Windows Application

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to open a Windows Application

    With some additional time on my hands (like most of us), i've decided to try a few new projects, and need some help.

    For the life of me, (not a dev), i cannot figure out the lines i'd write in a script to open up another Windows application.

    To be clear, i don't need help around how to create a script... what i specifically need is when the script runs, what is the code that will ultimately open another Windows 10 application. In this example, trying to open the Sonos client.

    this is what i worked out through my web search, but it doesn't work:

    "C:\Windows\System32\cmd.exe"
    start "Sonos" "C:\Program Files (x86)\Sonos\sonos.exe"

    That said, if i actually manually open the command prompt, the start command works perfectly.

    what am i missing?

    thanks!!!!

  • #2
    I believe for a script the call would be

    hs.launch("C:\Program Files (x86)\Sonos\sonos.exe", Parms, Dir, 0)

    where Parms are any parameters sent to the program and Dir is the directory where the application is launched from.

    I believe this is launched through .net.

    Comment


    • #3
      And if you don’t want to use the built-in HS command, the proper vb.net scripting call is Process.Start: https://docs.microsoft.com/en-us/dot...tframework-4.8
      HS 3.0.0.548: 1990 Devices 1172 Events
      Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

      Comment

      Working...
      X