No announcement yet.

Script to open a Windows Application

  • 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:

    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?


  • #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.


    • #3
      And if you don’t want to use the built-in HS command, the proper scripting call is Process.Start:
      HS 1990 Devices 1172 Events
      Z-Wave 126 Nodes on one Z-Net