Problem: os.startfile() opens multiple instances of my external exe

I’m trying to open a stereo movie file with BGE:

I use a simple keyboard sensor to activate the following python script [text.003]:
import os
os.startfile(“s3dplay_GP_track_002.bat”)

Here is the only line of content in the batch file:
StereoPlayer.exe -fss -file:doughbal-LR.wmv
(this uses the stereoplayer to open the file doughbal-LR.wmv full screen)

Here is the command line parameters for the stereoplayer:
http://3dtv.at/Products/Player/CmdLineParams_en.aspx

This does work - BUT it arbitrarily opens 1 or 2 instances of the program - I only want it to open a single instance per key input. Sometimes 1, sometimes 2 instances - ARRgh!

— I initially tried to open the exe along with the movie, but could not determine the right python syntax after MANY variations. Resorted to a .bat file.
— I turned on “tap” but no change.
— I even have the properties of the stereoplayer set to allow only one instance of the player, but it still incorrectly opens multiples.
— I tried using just the exe and get similar results (however it normally opens twice on the first key event, and only once thereafter) using - os.startfile(“stereoplayer.exe”)
— I can’t determine what is causing this.

Anyone seen a similar problem? Is there anything within logic that could help suppress, or does anyone have other ideas?

Win 7, BGE 2.59.0

Thanks.
:confused:

i 'd suggest to use

a keyboard sensor with 'all keys ’ ON – python controller

for the python script,
use the os.startfile along with keyboard detection script in documentation of the bge.events module in Blender 2.5 python api.

I’ve not found reference to the ['all keys ’ ON] python controller of which you mention - could you give me a better hint please?

I’ve looked up the “keyboard detection script” and I am trying to find/understand it also.
Is it in this area? http://www.blender.org/documentation/blender_python_api_2_59_2/bge.logic.html#bge.logic.keyboard

If you could give me an example of what you suggest I could probably work through it.

Thanks K.

@BGE_New - Kara was referring to the All Keys button on the Keyboard sensor.