Jump to content
Sign in to follow this  
KG200_Volker

Auto start TrackIR

Recommended Posts

I m not an expert in this and any suggestions or corrections are welcome.

 

This is a batch file (.bat) that you can copy and use to start TrackIR and then the Simulator with one shortcut.

 

What you have to do is copy the text below in notepad and save it as a "Whatever Name You Want.bat". Put the file wherever you want and create a shortcut from it to the desktop.

If you want it to have an icon from IL2, just right click the shortcut, choose "Properties", then "Change Icon", and point to your IL2.exe, finally choose the star icon from the list.

 

This text assumes that both IL2 and TrackIR are in C: disk, and its not a Steam version. If it is Steam version, check and correct the paths accordingly.

@echo off

tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER


:LAUNCTRIR
start "" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"
goto IL2LAUNCHER

:IL2LAUNCHER
tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "Il-2.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B

:NEXTPROGRAM2
goto COMPLETE


:LAUNCHIL2B
start "" "C:\Program Files (x86)\IL-2 Sturmovik Battle of Stalingrad\bin\game\Il-2.exe"
goto COMPLETE

 For those that have IL2 or TracIr in different disks.

 

The shortcut from the batch can't point to 2 different disks. So instead of pointing to the two .exes (Il2 and TrackIr), we ll make a secondary shortcut in the same disk as one of the two programs.

 

Example, TracIR is installed on disk C:\ , but IL2 is installed on disk F:\

Create a new shortcut where the batch file is, that points to IL2.exe, for our example I named the shortcut "IL2", and change the text to this:

@echo off

tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER


:LAUNCTRIR
start "" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"
goto IL2LAUNCHER

:IL2LAUNCHER
tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "Il-2.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B

:NEXTPROGRAM2
goto COMPLETE


:LAUNCHIL2B
start IL2.lnk
goto COMPLETE

Now the last line instead of pointing to a different disk that will make the shortcut unusable, it points to another shortcut that can be set to any disk in the system.

 

Hope that helps

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

I fixed so I thought I made sure it had the correct path but when I started it it told me that IL2 stopped working...

 

TrackIR works fine

Edited by 4./JG53_Badger

Share this post


Link to post
Share on other sites

Il2 stooped? Weird, all the .bat does is to run the program. If you want to be sure about paths, just go to your install folder of BOS, find the "Il-2.exe" right click on it and copy the path from "Location" line and paste it in .bat file.

 

A small addition, I had the problem that Trir takes a few seconds before it starts fully and the game was loading before this happens, so  i had to quit and restart IL-2.

To solve this add a delay command right beneath this line:

 

start "" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"

 

the command is this:

 

TIMEOUT /T #

 

The # is replaced with a number of your choice and it translates in seconds. For my PC I needed 3 sec to be sure TrIr is fully loaded before my IL2 starts, so test and find the best for you.

 

E.G. :

@echo off

tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER


:LAUNCTRIR
start "" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"
TIMEOUT /T 3
goto IL2LAUNCHER

:IL2LAUNCHER
tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "Il-2.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B

:NEXTPROGRAM2
goto COMPLETE


:LAUNCHIL2B
start "" "C:\Program Files (x86)\IL-2 Sturmovik Battle of Stalingrad\bin\game\Il-2.exe"
goto COMPLETE

Share this post


Link to post
Share on other sites

here my paths to my exe"s

 

Any chance you can make a batch file for me and I can test it on my system. I cant figure out what Im doing worng!

 

IL2

"C:\Program Files (x86)\1C Game Studios\IL-2 Sturmovik Battle of Stalingrad\bin\game\Il-2.exe"

 

TrackIR5

"C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"

 

I have windows 10

Share this post


Link to post
Share on other sites

Sory for your trouble but I m not a programming expert. I didnt mention that this works on my Win7 and it seems that Win10 have slightly different commands. From what i managed to understand the syntax for win10 must be this (I  used your paths so just copy/paste and save as .bat file):

@echo off

tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER


:LAUNCTRIR
cd "C:\Program Files (x86)\NaturalPoint\TrackIR5"
start TrackIR5.exe
goto IL2LAUNCHER

:IL2LAUNCHER
tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "Il-2.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B

:NEXTPROGRAM2
exit


:LAUNCHIL2B
cd "C:\Program Files (x86)\1C Game Studios\IL-2 Sturmovik Battle of Stalingrad\bin\game"
start Il-2.exe
exit

If this doesn't  work either try this small trick.

Create a shortcut for IL-2.exe in the same folder of IL-2.exe named for our example "BOS" (that would be for your case: C:\Program Files (x86)\1C Game Studios\IL-2 Sturmovik Battle of Stalingrad\bin\game)

 

And now use the original code but now instead of the .bat file starting IL2, it will execute the shortcut and the shortcut will start IL2.

So again copy/paste e.t.c. (used your paths as before):

@echo off

tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER


:LAUNCTRIR
start "" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"
goto IL2LAUNCHER

:IL2LAUNCHER
tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "Il-2.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B

:NEXTPROGRAM2
goto COMPLETE


:LAUNCHIL2B
start "" "C:\Program Files (x86)\1C Game Studios\IL-2 Sturmovik Battle of Stalingrad\bin\game\BOS.lnk"
goto COMPLETE

Now, the "BOS" shortcut can be anywhere in your system, I just used this paths for it to be easy. If you want to place it in another folder , just change the path in .bat accordingly.

Share this post


Link to post
Share on other sites

The first one you made for Win10. I took it one step further and dropped it in my main folder then right clicked on it and sent the shortcut to my desktop then I right clicked on the short cut and made the icon for it as my main icon from the bin folder. So now it looks just like the icon that was there before. Thanks a million bro!

Edited by 4./JG53_Badger

Share this post


Link to post
Share on other sites

Thanks for the code.

 

I'm having issues with the second half, launching the game. It gives me the error in the image attached.

 

I updated the paths to work with my game (different drives, TIR in E and game in X). Any suggestions?

 

 

 

@echo off

tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER

:LAUNCTRIR
start "" "E:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"
goto IL2LAUNCHER

:IL2LAUNCHER
tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "IL-2.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B

:NEXTPROGRAM2
goto COMPLETE

:LAUNCHIL2B
start "" "X:\Steam\SteamApps\common\IL-2 Sturmovik Battle of Stalingrad\bin\game\IL-2.exe"
goto COMPLETE

 


Also, any ways we can circumvent the user persmissions popup for TrackIR?

post-20591-0-90371900-1450649921_thumb.png

Share this post


Link to post
Share on other sites

Just add TIR to task scheduler and set

- Triggers: At log on (your account)

- Action: Start a program (provide a path to your Trackir5.exe)

 

Works like a charm for me (Win7 home premium 64)

No other programming needed...

Edited by ST_ami7b5

Share this post


Link to post
Share on other sites

Jade_Monkey, your system win7 or...

 

Did you keep the text format in the .bat file when you copied from here?

 

Please try to start the game directly from your .exe and see if you get the same memory error.

 

I don't get any permissions popup, probably making trir "Run as administrator" solves it.

Edited by KG200_Volker

Share this post


Link to post
Share on other sites

Just add TIR to task scheduler and set

- Triggers: At log on (your account)

- Action: Start a program (provide a path to your Trackir5.exe)

 

Works like a charm for me (Win7 home premium 64)

No other programming needed...

 

Nice one!  I wasnt very familiar with the task scheduler to be honest.

 

Jade_Monkey, your system win7 or...

 

Did you keep the text format in the .bat file when you copied from here?

 

Please try to start the game directly from your .exe and see if you get the same memory error.

 

I don't get any permissions popup, probably making trir "Run as administrator" solves it.

 

I dont get the error when running the game directly :(

Share this post


Link to post
Share on other sites

Assuming you only fly one simulator :) good stuff. will be good to add this to a shortcut of the game/Sim not Track IR 

Share this post


Link to post
Share on other sites

I just want to share my version including all the previous enhancements.

It's very simple and allow to start TrackIR and then Il-2 BOS, wait for Il-2 BOS to close and then close automatically TrackIR.

Tested on Win 10 64 bit with steam version of the game.

 Here's the script, just paste in a txt file and change format as .bat

Than it will work by double clicking.

@echo off

tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER


:LAUNCTRIR
echo Starting TrackIR...
start "" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"

TIMEOUT /T 3

goto IL2LAUNCHER

:IL2LAUNCHER

tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "Il-2.exe"

IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B

:NEXTPROGRAM2
goto COMPLETE


:LAUNCHIL2B
echo Starting Il-2
cd "C:\Program Files (x86)\Steam\steamapps\common\IL-2 Sturmovik Battle of Stalingrad\bin\game"
start /wait Il-2.exe
TIMEOUT /T 2
echo Closing TrackIR....
Taskkill /IM TrackIR5.exe

goto COMPLETE

Share this post


Link to post
Share on other sites

I tried Samueles script and it works a charm...except for the bit I really wanted to work,  shutting down TrackiR after I come out of the program.   My problem is that if I leave TrackiR running and the PC hibernates TiR gets confused and jams. Sometimes TiR being jammed also means that IL2 will lock up when I try to start it.  I then have to go into Task Manager to close TiR.

Share this post


Link to post
Share on other sites

Here is what I use.   It first checks if TiR is running and if it is it shut its down, waits 5 secs and restarts it and waits another 5 secs to be sure it is running before starting IL2 (I have an issue where TiR often jams if left running between game sessions)

 

When you exit the game it shuts down TiR again (the '/f' option forces it to close).    Note that I found I had to run the script with admin rights to allow it to close TiR so I made the batch file then made a shortcut to it so I could run it as Admin.

 

 

 

@echo off
Taskkill /f /IM TrackIR5.exe
TIMEOUT /T 5
tasklist /FI "IMAGENAME eq TrackIR5.exe" | find /i "TrackIR5.exe"
 
IF ERRORLEVEL 2 GOTO NEXTPROGRAM
IF ERRORLEVEL 1 GOTO LAUNCTRIR
:NEXTPROGRAM
goto IL2LAUNCHER
 
 
:LAUNCTRIR
echo Starting TrackIR...
start "" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"
 
TIMEOUT /T 5
 
goto IL2LAUNCHER
 
:IL2LAUNCHER
 
tasklist /FI "IMAGENAME eq Il-2.exe" | find /i "Il-2.exe"
 
IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
IF ERRORLEVEL 1 GOTO LAUNCHIL2B
 
:NEXTPROGRAM2
goto COMPLETE
 
 
:LAUNCHIL2B
echo Starting Il-2
cd "C:\Program Files (x86)\1C Game Studios\IL-2 Sturmovik Battle of Stalingrad\bin\game"
start /wait Il-2.exe
TIMEOUT /T 2
echo Closing TrackIR....
Taskkill /f /IM TrackIR5.exe
TIMEOUT /T 2
 
goto COMPLETE
Edited by 56RAF_Roblex
  • Upvote 1

Share this post


Link to post
Share on other sites

I am lost - Doesn't TRACKIR start for you gents automatically? I use Win 10 and I don't see the need for this 

Share this post


Link to post
Share on other sites
Posted (edited)

Its a shortcut to run Trackir program and then run IL2, so you wont go in to the sim forgetting to run trackir first.

Edited by KG200_Volker

Share this post


Link to post
Share on other sites
18 hours ago, KG200_Volker said:

Its a shortcut to run Trackir program and then run IL2, so you wont go in to the sim forgetting to run trackir first.

 

I see :) So you guys don't want TrackIR to start when Windows starts I take it?

Share this post


Link to post
Share on other sites

My TiR3 doesn't start automatically with Win 10 for some reason, even though the box is ticked.It used to so somethings changed, maybe it's just old. 

Share this post


Link to post
Share on other sites

I have my Track IR starting with windows since ages. Never needed to worry if it's active or not when starting any sim. 

But just putting it in autostart won't work. That's right. You need to tweak it to force Windows to run Track IR with the startup. I found a guide back then on a German tech side. 

But a Google research should be no problem to find a guide to force programs into the autostart I'm sure. 

Share this post


Link to post
Share on other sites
1. Press the Win + R key combination;
2. Enter the following command: regedit without quotes and press the Enter key;
3. Navigate to the following path or register key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run;
	In the name column, you can find the application that starts automatically, when Windows boots;
- Right click in the Registry Editor window and select New -> String value feature;
- Add value name (the name of the application);
- Add value data: enter the full path to the executable (*.exe) of the application that you wish to run at the startup

 

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  

×