Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Send commands to open application from command prompt  (Read 4296 times)

0 Members and 1 Guest are viewing this topic.

Skylark

    Topic Starter


    Starter

    • Experience: Experienced
    • OS: Windows 7
    Send commands to open application from command prompt
    « on: September 14, 2017, 06:24:36 PM »

    I was hoping someone might be able to help me with sending commands to the applications I just opened.
    I know each application is different perhaps you could teach me how to find these commands?

    I want to eventually be able to call a single batch file and launch a game or application (let's use StarCraft for an example) then log in, and start a game and run commands to play the game.

    I am under the understanding this is possible with MS-DOS.
    However, in the meantime perhaps we should just start with this example.

    I would like to launch VS2015 Command Prompt and make a call to unlock a file. I cannot seem to figure out how to make a call to the VS Developer Command Prompt after it is opened. Can you please help me with this please



    @echo off
    set "pathA=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2015\Visual Studio Tools\"
    set path=%path%;%pathA%
    start /max  "Developer Command Prompt for VS2015".lnk  cd "C:\Program Files (x86)\Microsoft Visual Studio 14.0\"
    echo. "C:\temp\Test.txt"



    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: Send commands to open application from command prompt
    « Reply #1 on: September 15, 2017, 09:59:45 AM »
    I am under the understanding this is possible with MS-DOS.
    No and very doubtful you are using MS-DOS.  A batch file cannot interact with Graphical User Interfaces.  If you need to do that try using Vbscript with Sendkeys method or use a program like AutoIt or AutoHotkey.

    Skylark

      Topic Starter


      Starter

      • Experience: Experienced
      • OS: Windows 7
      Re: Send commands to open application from command prompt
      « Reply #2 on: September 18, 2017, 02:28:42 PM »
      Thank you for saving me a boatload of time.  :)
      I appreciate your help, I will start learning vb now.