1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Problem connecting to FlyPT_FS2020.exe

Discussion in 'FlyPt Mover' started by Klaus Schmidinger, Apr 10, 2024.

  1. Klaus Schmidinger

    Klaus Schmidinger Member

    Joined:
    Oct 3, 2022
    Messages:
    40
    Balance:
    304Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    AC motor, Motion platform, 6DOF
    I want to make a batch file that starts everything necessary for my flight simulator. For FlyPT Mover I have created this file
    Code:
    <?xml version="1.0" encoding="Windows-1252"?>
    <SimBase.Document Type="SimConnect" version="1,0">
      <Descr>SimConnect</Descr>
      <Filename>SimConnect.xml</Filename>
      <Disabled>False</Disabled>
      <Launch.Addon>
        <Name>FlyPT Mover Motion Data Exporter</Name>
        <Disabled>True</Disabled>
        <Path>C:\Users\msfs\FlightSim\FlyPT-Mover\FlyPT_FS2020.exe</Path>
        <CommandLine>
        </CommandLine>
      </Launch.Addon>
    </SimBase.Document>
    
    as C:\Users\msfs\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\exe.xml
    to have it auto started with MSFS 2020. This works, but when it starts it pops up a command window
    cmd-01.png
    and even though I have checked the auto connect box in the SOURCE module, it doesn't fully connect (only goes yellow). I have to explicitly disconnect and connect again to make it go red. Then it works.

    Note that due to the fact that FS2020 takes very long to start, the FlyPT Mover program launches before the FlyPT_FS2020.exe is auto started by FS2020.

    @pmvcda Is there anything I can do to avoid the cmd window, and to have FlyPT Mover connect automatically to FlyPT_FS2020.exe?
  2. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,871
    Location:
    Portugal
    Balance:
    14,224Coins
    Ratings:
    +2,193 / 16 / -0
    My Motion Simulator:
    6DOF
    Hi,

    Please try a vb script:
    Code:
    Set objShell = CreateObject("Shell.Application")
    objShell.ShellExecute """steam://rungameid/1250410""", "" , "", "", 1
    WScript.Sleep(5000)
    objShell.ShellExecute """C:\Users\aaa\Desktop\FlyPT Mover.exe""", """C:\Users\aaa\Desktop\abc.Mover""" , "", "", 1
    Save it with the extension vbs.
    You might need to increase the sleep time to allow MSFS to start before Mover.
    There's a problem with simconnect in that Mover version causing the lock when trying to connect if Mover opened first. (solved for next release).

    Also the shortcut I used is for steam, youmight need a different one.
    Same for Mover and the setup file
    Use the """ because of spaces.

    If you want more info in vbs files, here's a link: https://ss64.com/vb/shellexecute.html
    • Informative Informative x 1
  3. Klaus Schmidinger

    Klaus Schmidinger Member

    Joined:
    Oct 3, 2022
    Messages:
    40
    Balance:
    304Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    AC motor, Motion platform, 6DOF
    To be honest I'm no fan of vb script.
    But since there is apparently nothing I missed and there is no "clean" solution to this in the current version of FlyPT Mover, I am now doing this in my batch file (amoung lots of other things):
    Code:
    set FS2020_APP=shell:AppsFolder\Microsoft.FlightSimulator_8wekyb3d8bbwe!App
    set FS2020_OPT=-FastLaunch
    
    set FLYPT_DIR=%USERPROFILE%\FlightSim\FlyPT-Mover
    set FLYPT_EXE=FlyPT Mover.exe
    set FLYPT_CFG=hexapod.Mover
    
    rem Start MSFS 2020:
    start "" /b "%FS2020_APP%" %FS2020_OPT% >nul
    
    rem Wait until the cmd window of FlyPT_FS2020.exe appears and minimize it:
    call window minimize "C:\Users\msfs\FlightSim\FlyPT-Mover\FlyPT_FS2020.exe" 100
    
    rem Wait until FlyPT Mover can connect to FlyPT_FS2020.exe (WHY???):
    timeout 15 >nul
    
    rem Start FlyPT Mover:
    start "" /b /min "%FLYPT_DIR%/%FLYPT_EXE%" "%FLYPT_DIR%/%FLYPT_CFG%" >nul
    
    The "window" script is a batch file that I wrote in order to minimize the PimxClient window, which is notoriously stubborn when it comes to minimize it from the command line:
    Code:
    @echo off
    
    rem Requires "AutoHotkey" from https://www.autohotkey.com/
    
    set ACTION=%~1
    if "%ACTION%" == "" goto :EOF
    set WINDOW=%~2
    if "%WINDOW%" == "" goto :EOF
    set TIMEOUT=%~3
    if "%TIMEOUT%"=="" set TIMEOUT=10
    
    set TMPFILE=%TEMP%\minimize.ahk
    
    echo SetTitleMatchMode(3)                 > %TMPFILE%
    echo if WinWait("%WINDOW%", , %TIMEOUT%) >> %TMPFILE%
    echo    Win%ACTION% ;                    >> %TMPFILE%
    "C:\Program Files\AutoHotkey\v2\AutoHotkey64_UIA.exe" %TMPFILE%
    
    del %TMPFILE%
    
    What I don't see is why I need the 15 seconds wait before starting Mover, since both MSFS and FlyPT_FS2020.exe have already been started. I tried various values, 10s was too short, 15s appears to work.
    That's good news!