TURNING ROUTES ON & OFF USING BATCH FILES

By Cyndi Richards

 

I would like to thank my good friend Otto Wipfel (OTTODAD) for the idea of using batch files. I have only expanded on his original idea by creating a comprehensive step by step guide. In my guides I like to stay with the KISS principle: KEEP IT SIMPLE STUPID! Thus, these batch files are the bare minimums to get you started.

This step by step will show you how to create batch files to turn your individual routes on or off. The starting portion of MSTS will load up much faster. The length of time you have a black screen before the route selection screen will remain the same. This is when MSTS is loading the engines and wagons.

 

TWO METHODS

 

Method 1 will allow you to turn individual routes "ON" and "OFF".

Method 2 will allow you to turn all routes "OFF" at once, and turn "ON" routes individually. 

 

BEFORE YOU BEGIN

 

Grab a pencil & paper and open the ROUTES folder. Write down the name of the ROUTE exactly as it appears on the folder, including spaces, underscores, etc. Now open the ROUTE folder and look for the file that ends with .trk  . Write down the file name exactly as it appears. Do this for each route in the folder. For MSTS to function properly one route must always be "ON". Scratch your favorite route from the list so it will always be "ON". For this example we will the route USA2, so wherever you see USA2, use the appropriate route folder name or .trk file name. 

 

METHOD 1

 

1.  Open WordPad, < NotePad in XP >.

 

2.  Type:  @ECHO OFF  <ENTER>

 

3.  Type:  CLS   <ENTER>

 

4.  Type:  C:    <ENTER> note: if MSTS is installed on a drive other

                               than "C" then enter drive letter in

                               place of "C"

5.  Type:

    CD\"PROGRAM FILES\MICROSOFT GAMES\TRAIN SIMULATOR\ROUTES\USA2"

                 <ENTER>             

 

6.  Type:  REN "USA2.OFF" "USA2.TRK"  <ENTER>                               

 

7.  Type:  CLS  <ENTER>

 

8.  At the top of the screen click on FILE, then SAVE AS.

 

9.  In the FILE NAME window type:  USA2-ON.BAT

                               

10. In the SAVE AS TYPE window click on the triangle at the right 

    side.

 

11. From the drop down menu select and click on,

TEXT DOCUMENT - MS-DOS FORMAT

         

12. Save file to location of your choice. When clicking SAVE a window

    will pop up with a message about formatting. Just click YES.

 

13. Congratulations! You have just created a batch file.

    Your original file should still be on the screen.

    DO NOT CLOSE IT!

    We now have to create a batch file to turn the route "OFF".

 

14. Go to the line that begins with REN.

 

15. Change "USA2.OFF" to "USA2.TRK" move the cursor to the right and

    change "USA2.TRK" to "USA2.OFF". The line should now read:

    

    REN "USA2.TRK" "USA2.OFF"

 

    This is just the opposite of the original text for that line.

 

16. Now follow steps 8 through 12. In step 9, name the file

    USA2-OFF.BAT

 

17. Repeat steps 1 through 16 for each route. Since the saved file is

    still on the screen all you have to do is change the Route Name     

    from USA2 to the next Route name and .trk file name

    (USA2.TRK and USA2.OFF) and save.

 

18. Once you have ON-OFF files for your routes done, go to where

    you have saved them. Create a new folder with your choice

    of name and place all the batch files in there.

 

19. Individual routes can now be turned on or off using the appropriate

    batch file. When clicking on a batch file your screen will turn

    black for an instant. Not to worry, just the .bat doing its thing.

 

METHOD 2

 

20. Follow steps 1 through 13 above to create "ON" batch files for

    each route.

 

21. Now to create a Master "OFF" batch file.

    Open WordPad or NotePad (XP).

 

22. Type:  @ECHO OFF  <ENTER>

 

23. Type:  CLS    <ENTER>

 

24. Type:  C:    <ENTER>  See note in step 4

 

25. Type: 

    CD\"PROGRAM FILES\MICROSOFT GAMES\TRAIN SIMULATOR\ROUTES\USA2"

             <ENTER>          

 

26. Type:  REN "USA2.TRK" "USA2.OFF"   <ENTER>

                              

 

27. Repeat steps 25 & 26 for each route before going to step 28.

 

28. Type:  CLS  <ENTER>

 

29. Follow steps 8 through 13 to save. In step 9 name this file:

    ALL-OFF.BAT

 

30. You can now turn OFF all routes with one click and turn ON the

    route(s) you want.

 

Cyndi Richards
BNSFLADY2081@aol.com

 

ALTERNATE METHOD

Richard Shirey (gizzmaxx@comcast.net), inspired by this original how to, offers an alternative batch file with PIF to link to it from Windows. Richards notes that the program command line in the PIF properties will have to be modified to the location where the batch file is placed. Also, the question mark on the command line should be not deleted, as it signals Windows to prompt for command line options.

Download Richard Shirey's version of the batch file.


[ Home ] | Message Forums | How To Menu ]

Copyright © 2004 by Nels Anderson. All Rights Reserved.