Please, need help with startup scripts and virtual keypresses

I have made an honest effort to research this. Apologies if this is basic or a repeat. (Such a complex hobby!)

I have a minimal homemade cockpit using two tablets and some peripherals. I am attempting to write a .bat file that will start/stop all of the stuff that I need to run for my flight simulation “experience”.

Two problems currently plague me.

  1. My batch files can not kill any processes (TrackIR5, SIMDashboard, Touch Portal) without being in admin mode, but when I run a batch file in admin, it prompts. Is it possible to kill tasks in admin without getting that stupid prompt? I know that it’s about security but I am already in admin mode when I run the batch file. Tried tons of stuff from the web (like powershell runas), but everything I tried prompts.

  2. What is the best way to programmatically send keypresses to MSFS from a python script? I am running pocketsphinx within a task which converts my spoken words into function calls but so far, nothing I’ve tried works (pyautogui, etc). I’ve gotten close with some code from stackoverflow*** but it only works once for each key unless I click outside of MSFS and back in again (???).

Any help would be greatly appreciated and thanks ahead of time.

*** emulation - Simulate physical keypress in python, without raising LowLevelKeyHookInjected (0x10) Flag - Stack Overflow

I fixed issue 2. The bug turned out to be yet another case of sloppy programming by yours truly. I now have voice control of keyboard presses. Great for communicating with the tower.

Unfortunately, issue one has now become further complicated by Touch Portal not working. It appears to be some problem with USB connections between the pad and PC. Has anyone else seen this?

I also run SIMDashboard on the same hardware, but not at the same time, of course. SIMDashboard works perfectly every time.

As usual, thanks ahead of time for any feedback.