Batch Files to Open and Close Flight Simulator

Opening and closing the various files and ancillary programs to operate a flight simulator can be onerous and time consuming.  While there have been several programs released that enable you to launch flight simulator with a press of a key, they seldom work with complicated platforms such as flight decks. 

One of the most commonly used methods to open files and programs is to use the start menu within Windows.  However, this is not without it’s shortcomings, and specialist knowledge is required.  An easy and trouble free approach is to use batch files.

What is a Batch File

A batch file is a script file that stores commands to be executed in a serial order.  It helps automate routine tasks without requiring user input or intervention. Some common applications of batch files include loading programs, running multiple processes or performing repetitive actions in a sequence in the system.

Also known as a batch job, a batch file is a text file created in Notepad or some other text editor.  A batch file bundles or packages a set of commands into a single file in serial order.  Without a batch file these commands would have to be presented one at a time to the system from a keyboard.

Usually, a batch file is created for command sequences when a user has a repetitive need.  A command-line interpreter takes the file as an input and executes the commands in the given order.  A batch file eliminates the need to retype commands, which saves the user time and helps to avoid mistakes.  It is also useful to simplify complex processes.

Windows usually uses the .bat extension for batch files.

Whilst there are several methods that can be used to write a batch file, I have found that the examples below operate flawlessly.

Writing a Batch File

It's a simple process to write a batch file. 

Prior to beginning, it’s wise to think about the order you want the programs to open, and whether you want a pause between opening particular files and programs.  While a pause is probably not necessary, it’s a good idea as it allows a file or program to complete its opening sequence, prior to the next file or program opening.

When you have completed writing the batch file in notepad save the file with a .bat extension.  To test the batch file double click on the saved .bat extension.

Although others will disagree, I always open the MSFS-2020 or P3d and allow the program to settle before opening any batch file or other programs.

The following examples of batch files are user-specific.  You will need to substitute the file structure with the file structure you are using.

Opening Files and Programs

  • An example of a batch file to open the main flight simulator computer (server).

@Echo  off

//Alpha Main Server Computer (ALPHA-SERVER-P3)  - 09:38 - 25/08/2023

//ProSim738 V3

//ProSim Ancillary Programs

start /d "D:\Flight Simulator Files\SimStacks October 2021\SimStackSwitchv702" Switch.jar

Timeout 0.5

start /d "D:\Flight Simulator Files\FS Set Volume" FSSetvol.exe

Timeout 0.5

start /d "D:\Flight Simulator Files\SimSounds 4.0" SimSounds.exe

Timeout 1

start /d "D:\REX WeatherForce.exe

//ProSim Main Programs

start /d "D:\Flight Simulator Files\ProSim738 V3\ProSimAudio" ProsimAudio.exe

Timeout 1

start /d "D:\Flight Simulator Files\ProSim738 V3\ProSimB738" ProSimB738.exe

An example of a batch file to open the avionics suite on the second computer (client 1).

@Echo off

//Client 1 - ProSim-AR B738 Avionics Suite V3    14:07 5/09/20

//PS738 V3

//Ancillary Programs

start /d "C:\Users\user name\Documents\FSF\Programs\MSFS WideFS7" kilo

start /d "C:\Users\user name\Documents\FSF\Programs\Landing Rate Monitor" LRM.exe

start /d "C:\Users\user name\Documents\FSF\Programs\SimSounds 4.0" SimSounds.exe

//Hardware Connector

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\ProSimB738-HardwareConnector" ProSimB738-HardwareConnector.exe

//ProSim737 Displays and Indicators

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\Displays\CAPT PFD" ProsimDisplay.exe

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\Displays\CAPT ND" ProsimDisplay.exe

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\Displays\FO PFD" ProsimDisplay.exe

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\Displays\FO ND" ProsimDisplay.ex

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\Displays\EICAS" ProsimDisplay.exe

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\Displays\FLAPS" ProsimDisplay.exe

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\PS738ChronoCaptain" ProsimDisplay.exe

Timeout 3

start /d "C:\Users\user name\Documents\FSF\ProSim738 V3\ProSimIOS" ProSimIOS.exe

Closing Files and Programs

Likewise, you can also use a batch file to close files and programs sequentially or simultaneously (kill all).

An example of a batch file used to close programs on the main flight simulation computer (server).

@Echo off

//Alpha Main Server Computer (ALPHA-SERVER-P3)  - 09:38 - 25/08/2023

//ProSim738 V3 – closure batch

taskkill /IM wideclient.exe

Timeout  2

taskkill /IM ProSimAudio.exe

Timeout  1

taskkill /IM PMSounds.exe

Timeout 1

taskkill /IM Prosim737.exe

Timeout  4

taskkill /IM fs2020.exe

  • im specifies the image name of the process to be terminated (for example, PMSounds.exe or ProSim737.exe).

  • @echo on/off defines whether a name or message will be displayed on the console.  It’s also used for other tasks such a script troubleshooting.  I have used it in my batch files because I was told it was a good idea to do so, but if you don’t use the @echo command the batch file still works.  If you do use the @echo command I recommend you use @echo off as this will turn off this feature.

  • The // syntax is used to stop the line from being read by the batch file. 

In the examples, the Taskkill command has been used to close the programs.  Taskkill will cause the program to terminate gracefully, asking for confirmation if there are unsaved changes.

To forcefully kill a process, add the /F option to the command line. Be careful with the /F option as it will terminate all matching processes without confirmation.

An example using the /F command is: Taskkill /F /IM ProSimAudio.exe.

There is debate in the computer community to the validity of closing files and programs simultaneously, as ‘killing a program’ may not allow the program enough time to save information it may be saving during the closure process.

For this reason, I'm hesitant to close flight simulator (or other programs) using a closure batch file without a timeout or delay sequence.  Needless to say, it's an easy process to configure a time delay into a batch file to create a delay before closing each program.

Timeouts

Depending upon your computer specifications, some programs may open and close at differing speeds.  If you want a program is open or close before the next program, then a delay sequence will need to be timed into your batch file. 

The timeout command is used to trigger a delay between the programs, enabling any read/write requirements to occur prior to the next program beginning it closure routine.  The numeral denotes seconds or part thereof. 

Streamlining

Once you have created and saved the batch file, a suggestion is to create a shortcut to the file.  Doing this will enable you to make changes to the batch file such as how the file is executed (minimised or maximised), the position on the screen, colour and font style used, and whether to use an icon for easy identification.  Additionally, by creating a shortcut it enables you to place the shortcut on your task bar.

To create a shortcut, right click the batch file and save as a shortcut.

Using Batch Files and ProSim IOS

ProSim-TS IOS screen in opened to network page.  Rather than explain everything, copy the details and use trial and error to achieve your desired result

If you are using multiple computers, you may want to use the ProSim Instructor Operator Station (IOS) to trigger the opening or closure of programs (via the batch file).  When IOS is configured correctly, you will be able to open and close a batch file on one or more networked computers from one computer screen.

To configure IOS, open the network tab, select add a new action or type and select start program.  In the path to executable file on client box type the file address of the batch opening file.  Choose the start option you prefer and ensure that enabled in checked.

To close your programs, open a second action and type in to the path to executable on client box the file address of the batch closure file.

The accompanying image should be self explanatory.

There are other ways to do this, however, this method is probably the simplest.

Caveat

I am not computer technician.  I have used batch files similar to the examples shown for many years without issues.

Final Call

Batch files are but one way to minimise workload and automate the opening and closure of ancillary programs that are used with flight simulator.  The use of IOS to trigger batch files also enables the user to open and close ancillary programs from the one computer screen (instructor station).

Updating ProSim-AR Visual Flight Model (VFM) Without Loosing Configuration Data

Updating ProSim-AR Visual Flight Model (VFM) Without Loosing Configuration Data

ProSim-AR produces a dedicated visual flight model (VFM) that can be used with ProSim737.  The VFM reflects the aerodynamics and flight parameters of the real-world Boeing 737 in addition, to displaying a visual representation of the aircraft in a selected number of real-world airline liveries.

Read More

Commercial Rotary-String Potentiometer Review

Commercial Rotary-String Potentiometer Review

Recently, whilst on a final approach I heard a ‘twang’ followed by loss of aileron control.  I knew immediately what had happened; the tensioned stainless steel string from the string potentiometer had snapped and the wire had retracted into the mechanism. 

Read More

Changing Sound in the ProSim 737 Aircraft with MSFS-2020

Many enthusiasts like to change the sound files that come with ProSim-TS 737 aircraft.  In my simulator I use an assortment of sounds including those from ProSim, PMDG, the immersion CFM engine sound pack, and audio recordings that have been made from the real aircraft.

Read More

ProSim737 IOS - Unconventional Settings

The user interface in the Instructor Operator Station (IOS) allows the user to customise several functions, in addition to enabling or disabling specific options.  Whilst most of the functions are straightforward, there are several options that are unconventional and therefore, probably not clearly understood.

Read More

Switch-mode Power Supplies

Upper unit is a MeanWell switch-mode power supply with internal cooling fan.  The lower unit is a generic Chinese made power supply with no internal cooling fan; ventilation is provided by the perforated outer case and by inclusion of an internal aluminium heat sink.  Note that the MeanWell power supply has easier access to the terminals and is much thinner in depth than the lower unit

Every simulator needs some type of power supply, whether it be a converted multi-volt computer power supply, a plug in the wall type power pack, or a dedicated set voltage AC/DC switching power supply.  I dare say that most flight simulators have an assortment of different types that convert 240/110 Volts AC power to DC power at a specific wattage and amperage.

In this article, I will discuss switching power supplies (switch-mode).  I will also very briefly address how to measure amperage using a multimeter.

Switch-mode Power Supplies

There are many types of power supplies.  However, for the most part a switch-mode power supply is the most versatile.

A switch-mode power supply is an electronic power supply that incorporates a switching regulator to convert electrical power efficiently from a higher AC voltage to a lower specified lower DC voltage.   This is done by converting the incoming mains power into a frequency between 20-kHz to 500-kHz AC that is then stepped down to a lower voltage (using a small integrated transformer).  The voltage is then rectified, filtered and regulated.

Clean Power

Clean power refers to power that is filtered and regulated, meaning the power is clean and is regulated to a predefined voltage.   This is important in the simulator environment because many interface cards and OEM components do not tolerate inconsistent voltage which can easily be the cause of inconsistent operation and USB disconnects.

In general,  a less expensive power supply will generate unclean power.

Power Supply Selection

Several companies produce power supplies – most of them are manufactured in China.  However, one company that stands out from the many is MeanWell (MW).  MeanWell is a Taiwanese company (not Chinese) that is a leading manufacturer of power supplies, and their switch-mode power supplies provide many advantages to the flight simulator builder.

Some of the advantages of using MeanWell power supplies are summarised below:

  • Constant source of clean power rated at 20% above the certification provided.  What this means is that if you run the power supply at 100% it has a further 20% before the unit will be damaged.

  • Protection from short circuit, overload and over voltage.

  • Fixed switching at 25 kHz (produces a cleaner and better regulated power).

  • Two or three year replacement warranty (model dependent).

  • Internal cooling fan (model dependent).  Fan opersation is temperature controlled.

  • Audible alarm that sounds if operating temperature is exceeded (model dependent).

  • Adjustable voltage (the voltage can be manually adjusted up or down (-+) to ensure correct voltage).

  • Wide range of operating conditions (-25 Celsius to 70 Celsius).

  • Solid enclosure with perforated holes (efficient heat sink and cooling).

  • Easy screw attachment point or ability to use a rail system.

How Many Power Supplies Do I Need ?

This is a difficult question to answer as every simulator platform is different. 

The most effective way to determine the number and size of each power supply is to calculate the amperage draw of the items that will be connected to the power supply.  Armed with this information, you can decide what power supply and amperage is needed.

A flight simulator will usually require switch-mode power supplies in 5, 12 and 28 volts of varying amperages, and the cost of each unit will increase as the amperage rating increases.

While it’s possible to wire a number of lower amperage rated power supplies together, I believe using two or three individual larger amperage units is better than several smaller amperage units.

Amperage Draw and Calculating Amperage

Every item that draws power uses amperage, and the amount of amperage necessary for the component to operate must be calculated prior to selecting a power supply of a set amperage.   Using a power supply that is over-rated, in other words has more amperage than is necessary for a given situation is not a problem, however, using a power supply that does not have enough amperage for the attached device will result in either partial or complete failure of the connected device (for example, a bulb or LED may not illuminate to full intensity).

Amperage is the strength of electricity flowing through a circuit, usually from positive to negative.

To calculate amperage draw for a specific component, for example a 5 volt bulb, you will require a multimeter that has the capacity to read amperage.

There are several U-Tube videos on the Internet that provide guidance in how to use a multimeter to read amperage, so I will not replicate what is available.  

To begin, the mulimeter's red wire from is placed into the AMP outlet and the black lead is placed into the COM outlet of the multimeter. 

You then break the closed circuit of the Korry by removing the Korry from its holder.  You connect the red wire (AMP) from the multimeter to the positive side of the Korry.  The black wire (COM) is attached to the connector (holder) that the Korry was removed from. 

Essentially you are closing the circuit with the multimeter in-line.  Make sure the multimeter is set to read amperage (A).  Then turn on the DC power to the Korry.  The multimeter will read the amperage draw when the Korry is illuminated.

Important Point:

  • Prior to connecting the wires from the multimeter, check that the fuse (usually 10 amps) is functioning inside the multimeter.   If you have a blown fuse and connect power to the multimeter, you may damage the device’s internal components.  Every multimeter is slightly different, therefore, consult the operating manual    

Rather than duplicate what already has been done, below are three links to U-Tube videos that explain how to use a multimeter to measure amperage. 

Installation of Switch-mode Power Supplies

An advantage of using the same type/brand of power supply is the ease in mounting the power supplies.  Most power supplies have a number of screw holes that enable the unit to be screwed to a prefabricated bracket, or mounted to a solid board; some can also be attached to a rail system.

My Simulator Set-Up

In my simulator, I have installed what is called a Power Supply Rack (PSR) which is located forward of the Main Instrument Panel (MIP) on the platform floor. 

The rack is essentially an open frame L-shaped bracket made from wood (nothing fancy).  To this the power supplies are mounted.  The individual power supplies are wired together in parallel (wire connects between positive terminals on each power supply) to enable connection to the mains power by one power cable.

The open frame L-bracket has several advantages: all the power supply units are located in the one location, it’s straightforward to add another power supply as needed, and an open frame structure enables good ventilation and airflow; power supplies when operated for an extended period of time can generate considerable heat.

Present on all power supplies is the voltage regulator.  This enables the outgoing voltage to be adjusted, usually to a few volts either side of the advertised voltage.  Also note the barriers between each of the terminals and the nomenclature marking above each of the terminals

Safety

Switch-mode power supplies usually have at the end of the unit a terminal bar.  The incoming mains power (three wires) is connected to the two AC and Earth terminals.  Directly adjacent are four or six terminals marked +V and -V (outgoing).   This is where you connect the +- wires from your device.  The two AC terminals (incoming) when connected to mains power are always LIVE; touching these terminals will cause a life-threatening electric shock.  Therefore, it’s paramount that these terminals are covered.

Some power supplies come with a plastic protective cover that is clipped in place after the wires are connected; all have plastic barriers between each terminal to minimise the accidental touching of wires. 

If the power supply does not have a cover, one can easily be made using a piece of plastic and held in place by electrical tape.  Clear silicon or hot glue can also be used to cover the AC and Earth terminals; the advantage of hot glue being that it’s easily removed by applying 80% alcohol.  At the minimum, red-coloured electrical tape should be used to tape over the terminals.

Safety is important when working around 240/110 volts AC and strict protocols should be followed at all times.  If in doubt, always disconnect the power supply from the mains power prior to doing any maintenance.

Single circuit busbar and multiple circuit terminal bar

Power Distribution (busbars and terminal blocks)

Any flight simulator requires various voltages to function.  For example, backlighting requires 5 volts DC while OEM annunciators (Korrys) require 28 volts DC. 

Power distribution, depending upon your skill level, can become quite elaborate and complicated, but at its simplest level is the use of busbars and terminal blocks.

Busbars and terminal block appear similar, however, are used for differing applications.

The main difference is that a busbar gathers multiple wires together for power distribution in a single circuit (one voltage).  In contrast, a terminal block has separate circuits where each wire is paired with an outgoing wire.  A simple way to think about it is, that a busbar is a single circuit whereby a terminal block is multiple circuits. 

There are as many manufacturers as there are types of busbars available;  it's also relatively straight forward to convert an inexpensive terminal bar into a busbar by routing the power wire between each terminal/circuit (the wires look like the letter U between each of the circuits/terminals).  Doing this enables one terminal to be allocated to incoming power (for example 5 Volts) rather than an incoming power wire being connected to each circuit.

Importantly, when wiring busbars or other items care must be taken to the gauge of wire used.  You don't want to use a thin piece of wire (minimal number of wire strands) when connecting to a high amperage item.  If you do, the wires will become very warm and the amperage that travels through the wire will drop (which may cause inconsistent operation or a USB dropout - if the wired item is connected to the computer by a USB cable).  A worse case scenario is the wire will melt and a fire may occur.

Blue Sea Systems busbar with transparent cover

My Simulator Set-Up

In my simulator, installed behind the Main Instrument Panel (MIP) is a small shelf on which three heavy duty high amperage busbars are mounted (5, 12 and 28 volts respectively).  Each busbar connects directly to various components. 

A further 5 and 12 volt busbar has been installed to the inside of the center pedestal, and these busbars provide 5 and 12 volt power to OEM panels, Belkin USB hubs and an Ethernet switch. 

Additional 5 and 12 volt busbars are located within the Throttle Communication Module (TCM); a small box mounted to the forward firewall of the throttle quadrant.

For the most part, I have used marine-grade busbars manufactured by Blue Sea Systems (an American company).  Although the clear acrylic covers are not necessary, they do minimise the chance of a short circuit occurring should something drop onto the busbar.

Dedicated Power Supply to Specific Aircraft Systems

It is preferable to dedicate individual power supplies to specific aircraft systems.

The advantage of linking a dedicated power supply to a particular aircraft system, is if a catastrophic failure should occur, the problem will be maintained within that system and any power leakage/spike will not be able to travel to other systems (located on a separate power supply). 

A further benefit is that the amperage draw for each power supply can be easily measured to ensure it doesn't exceed 80% of the total draw available.  Effectively, this should increase the longevity of each power supply as it will not be operating at full output. 

Troubleshooting is also easier when you know what functions are connected to each power supply.

Operating OEM components requires a relatively high amperage draw, and whilst it's feasible to 'piggy back' two power supplies of the same amperage to effectively double your amperage, this is not advisable. 

Maintenance

In general, power supplies do not require maintenance.  However, depending upon the working environment, dust can build-up on the internal workings of the unit.  If dust does build up, the unit should be routinely cleaned with a small vacuum cleaner or lint free cloth – this is especially so for those units that have an internally-driven fan which can ingest dust particles.  If a ‘thick’ layer of dust is allowed to accumulate, there is a chance that the unit may operate at a slightly higher temperature, thereby minimising service life, and perhaps altering voltage output.

Final Call

There are several types of power supplies that can be used to power components in a flight simulator; the most versatile are switch-mode power supplies.  MeanWell, a Taiwanese company, manufactures a number of switch-mode power supplies that in many ways are superior to its competition.  However, prior to using any power supply the total amperage draw of the simulator’s components should be calculated to ensure that the most appropriate switch-mode power supply is used.