Jump to content
Sign in to follow this  
ark

Starting Multiple Flight Sim Files with a Single Click

Recommended Posts

I thought I'd pass the below on for those that might find it useful.

I typically have seven or more programs that I use together in the flight sim, so I decided to put together a tiny batch (.bat) file, as shown below, to start up all the programs with just one mouse click. You can put different batch files together for different flight sim scenarios, e.g., batch files for when or when not using VATSIM , etc.  For startup convenience you can then put a batch file shortcut on your desktop, or you can pin it to the task bar, which I prefer ( *see below).  

The basic structure of the batch file is fairly simple, for each program you provide the directory path to the executable file, and a start command.

 For those unfamiliar with batch files:

REM … indicates a REMark

@echo off … turns off the display of command prompts

cd … change directory. For each program you want to start you provide the path to the .exe file directory in QUOTES (it can also work without the quotes, but to prevent problems such as white space in folder names from being interpreted as a delimiter, it is best to use quotes to be safe).

start … starts the associated program

start /min … starts the associated program minimized (whether this works seems to depend on the program)

TIMEOUT /Tn … inserts an n second pause in the batch file execution stream. I use this to give the system some disk access time, may not be necessary.

exit … exits the batch file and closes the command window

My batch file looks something like this:

REM Start_P3Dv4SimPrograms.bat, a batch file  to start programs for P3Dv4
REM  12April 2019

@echo off

REM Start Voice Attack
cd "C:\Program Files (x86)\VoiceAttack"
start VoiceAttack.exe
REM Insert 2 sec pause
TIMEOUT /T 2

REM  Start Active Sky for P3Dv4
cd "C:\Program Files (x86)\HiFi\AS_P3Dv4"
start  AS_P3Dv4.exe
REM Insert 2 sec pause
TIMEOUT /T 2

REM  Start TrackIR
cd "C:\Program Files (x86)\NaturalPoint\TrackIR5"
start /min TrackIR5.exe
REM Insert 2 sec pause
TIMEOUT /T 2

REM  Start LittleNavMap
cd "C:\Users\Al\Documents\Al's Flight Simulation\AddOns\Little NavMap&NavConnect\LittleNavmap-win-2.2.4\Little Navmap"
start littlenavmap.exe
REM Insert 2 sec pause
TIMEOUT /T 2

REM  Start P3Dv4
cd "C:\P3Dv4"
start Prepar3D.exe
REM Insert 12 sec pause
TIMEOUT /T 10

REM  Start Kneeboard Viewer 2
cd "C:\Users\Al\Documents\Al's Flight Simulation\AddOns\KneeboardViewer\KVv2.0\KV2Files"
start KV2.exe
REM Insert 2 sec pause
TIMEOUT /T 2

REM Start PDF Lite
cd "C:\Program Files (x86)\PDFlite"
start PDFlite.exe

exit

*How to pin a batch file to the taskbar

You have to play a 'trick' on Windows to pin a batch file to the Taskbar by temporarily making the .bat file look like a .exe file.

1. Go to the bat file location and rename the .bat file extension to .exe (ignore the warning).

 2. Right click the ‘new’.exe file and pin it to the task bar like for any other .exe file.


 3. Once the file is pinned to the taskbar, go back to the original file and rename it back to having a .bat extension; save it.

4. Shift+right click on the newly pinned .exe taskbar icon and select the Properties option.

5. Change the file extension from .exe to .bat at the end of the taskbar icon’s Target field and save the change (OK).

6. If the newly pinned taskbar icon doesn’t work for some reason, try rebooting the computer.

Al

 

Edited by ark
  • Like 1

Share this post


Link to post
Share on other sites

Just another example showing different disk drives, and file names that include spaces..

REM Start P3Dv4.bat,  1 May 2019

@echo off

REM Start RTSS
cd "C:\Program Files (x86)\RivaTuner Statistics Server"
start RTSS.exe
REM Insert 2 sec pause
TIMEOUT /T 2

REM  Start P3Dv4
cd /D "F:\Program Files\Lockheed Martin\Prepar3D v4"
start Prepar3D.exe
REM Insert 12 sec pause
TIMEOUT /T 10

REM  Start FFTF Dynamic
cd /D "C:\Program Files\FSPS LTD\FFTF Dynamic P3Dv4"
start "" "FFTF Dynamic P3Dv4.exe"

exit

Edited by Bert Pieke

Bert

Share this post


Link to post
Share on other sites
11 hours ago, Bert Pieke said:

Just another example showing different disk drives, and file names that include spaces..

REM Start P3Dv4.bat,  1 May 2019

@echo off

REM Start RTSS
cd "C:\Program Files (x86)\RivaTuner Statistics Server"
start RTSS.exe
REM Insert 2 sec pause
TIMEOUT /T 2

REM  Start P3Dv4
cd /D "F:\Program Files\Lockheed Martin\Prepar3D v4"
start Prepar3D.exe
REM Insert 12 sec pause
TIMEOUT /T 10

REM  Start FFTF Dynamic
cd /D "C:\Program Files\FSPS LTD\FFTF Dynamic P3Dv4"
start "" "FFTF Dynamic P3Dv4.exe"

exit

To elaborate a bit on the excellent points Bert's example makes, the /D in cd /D indicates a change of Disk drive, and the quotes around file names prevents spaces in the names from being interpreted as a delimiter (which is the same reason it is best to use quotes around director paths).

Thanks Bert,

Al

Edited by ark
  • Like 1

Share this post


Link to post
Share on other sites

BTW, you can also use a batch file like the above to set a program's Affinity Mask. For example, to set the Affinity Mask for Active Sky to 1110 (Hex E) in the batch file above to keep Active Sky from using CPU core 0, you would do something like this:

REM  Start Active Sky for P3Dv4
cd "C:\Program Files (x86)\HiFi\AS_P3Dv4"
start "" /AFFINITY E  "AS_P3Dv4.exe"
REM Insert 2 sec pause
TIMEOUT /T 2

Al

EDIT: For clarification, I should point out that my CPU only has 4 cores (and no HT), and so the Affinity mask is only 4 binary digits (a single Hex character).

Edited by ark
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...