Jump to content


Photo

Auto start TrackIR


  • Please log in to reply
21 replies to this topic

#1 KG200_Volker

KG200_Volker
  • Founder
  • Posts: 295
  • Location:Greece

Posted 27 October 2015 - 00:04

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

 

 

 

 

 

 

 


  • 0

kgser.jpg

random_expert_chrome.png


#2 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 02 November 2015 - 01:06

Thanks mate Im gonna give it a try!


  • 0

Badg_Sig_1.jpg


#3 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 10 November 2015 - 23:20

I tried this but its not seeing my IL2 exe file and I have it in the c drive standard install


  • 0

Badg_Sig_1.jpg


#4 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 10 November 2015 - 23:25

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, 10 November 2015 - 23:28.

  • 0

Badg_Sig_1.jpg


#5 KG200_Volker

KG200_Volker
  • Founder
  • Posts: 295
  • Location:Greece

Posted 27 November 2015 - 08:53

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

  • 0

kgser.jpg

random_expert_chrome.png


#6 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 29 November 2015 - 01:11

I'll give this another try, but that last time I did what you said and it would load IL2 then it kept saying that game stopped working


  • 0

Badg_Sig_1.jpg


#7 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 29 November 2015 - 18:17

nope still not working correctly


  • 0

Badg_Sig_1.jpg


#8 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 29 November 2015 - 18:32

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


  • 0

Badg_Sig_1.jpg


#9 KG200_Volker

KG200_Volker
  • Founder
  • Posts: 295
  • Location:Greece

Posted 06 December 2015 - 19:19

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.


  • 0

kgser.jpg

random_expert_chrome.png


#10 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 07 December 2015 - 14:49

Thanks Ill give it a go when I get home from work today!


  • 0

Badg_Sig_1.jpg


#11 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 08 December 2015 - 20:20

Hey

it worked great, Thanks again!


  • 0

Badg_Sig_1.jpg


#12 KG200_Volker

KG200_Volker
  • Founder
  • Posts: 295
  • Location:Greece

Posted 09 December 2015 - 09:15

Which solution? So win10 owners can choose accordingly.
  • 0

kgser.jpg

random_expert_chrome.png


#13 II./JG53_Badger

II./JG53_Badger
  • Founder
  • Posts: 338
  • Location:Galloway, NJ

Posted 10 December 2015 - 00:38

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, 10 December 2015 - 00:40.

  • 0

Badg_Sig_1.jpg


#14 Jade_Monkey

Jade_Monkey
  • Founder
  • Posts: 3726

Posted 20 December 2015 - 22:19

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?

Attached Files


  • 0

i7 7700k  | GTX 1080 Ti |   16GB Corsair Dominator DDR4  |  LG 34UM95 3440x1440 | HTC Vive | TrackIR 5  |  Saitek X-55 HOTAS  |  MFG Crosswind graphite pedals


#15 ST_ami7b5

ST_ami7b5
  • Tester
  • Posts: 2409

Posted 21 December 2015 - 11:43

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, 21 December 2015 - 11:51.

  • 0

i7-2600k @ 3.40 (3.70) GHz. 8 GB RAM, W10/64, GTX 780 (337.88 driver)


#16 KG200_Volker

KG200_Volker
  • Founder
  • Posts: 295
  • Location:Greece

Posted 21 December 2015 - 13:19

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, 21 December 2015 - 13:20.

  • 0

kgser.jpg

random_expert_chrome.png


#17 Jade_Monkey

Jade_Monkey
  • Founder
  • Posts: 3726

Posted 22 December 2015 - 00:30

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 :(


  • 0

i7 7700k  | GTX 1080 Ti |   16GB Corsair Dominator DDR4  |  LG 34UM95 3440x1440 | HTC Vive | TrackIR 5  |  Saitek X-55 HOTAS  |  MFG Crosswind graphite pedals


#18 GOZR

GOZR
  • Founder
  • Posts: 304
  • Location:Ashland, Oregon

Posted 22 December 2015 - 06:03

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


  • 0

#19 ITAF_Samuele

ITAF_Samuele
  • Member
  • Posts: 6

Posted 10 April 2016 - 16:35

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

  • 0

#20 56RAF_Roblex

56RAF_Roblex
  • Member
  • Posts: 613
  • Location:Cornwall, UK

Posted 16 September 2017 - 16:48

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.


  • 0

Diary Of A HopelessPilot Officer - http://roblex56raf.livejournal.com/    

56thmi11.jpg56th GvIAP 'Firebirds' 

 BoM, BoS, BoK, La-5, La-5FN, P-40, Spitfire, Yak-1B, HS-129


#21 AstroCat

AstroCat
  • Founder
  • Posts: 50
  • Location:USA

Posted 26 November 2017 - 14:50

ITAF_Samuele The script works good except it doesn't seem to close TrackIr down after you exit IL2. Any ideas? 
  • 0

Home/Gaming PC: I7-6700K@4.5GHz/Asus Rog Maximus VIII Formula/EVGA GTX 1080 SC/Corsair Vengeance LPX 16GB (2x8GB)/Corsair Carbide Quiet 600Q/Corsair RM750i/Acer XB270H 27"/BenQ G2400W 24"/Sound Blaster ZX/Samsung 850 Pro SSDs x2/Samsung 950 Pro x1/Win10 Pro 64bit/Saitek X52/TrackIR5: Pro-TrackClip Pro/


#22 56RAF_Roblex

56RAF_Roblex
  • Member
  • Posts: 613
  • Location:Cornwall, UK

Posted 26 November 2017 - 16:21

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, 26 November 2017 - 16:25.

  • 1

Diary Of A HopelessPilot Officer - http://roblex56raf.livejournal.com/    

56thmi11.jpg56th GvIAP 'Firebirds' 

 BoM, BoS, BoK, La-5, La-5FN, P-40, Spitfire, Yak-1B, HS-129





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users