EDIT: Seemingly solved. Solution was to specify pathway to run pnputil.exe to it's install location in "C:\Windows\WinSxS\amd64_microsoft-windows-pnputil_31bf3856ad364e35_10.0.22621.2506_none_dd3e282938270e6f\pnputil.exe". Depending on update, the random string of letters might change, I found it by opening the WinSxS file and searching for "pnputil" to find the correct folder, and then copying the EXE within's path.
TLDR; I have a .bat file that must be ran as administrator. How do I do so from the running script of an emulator in Launchbox?
Hello,
I'm hoping somebody can help me out with an issue I'm having getting my cab working properly.
The cabinet is running a standard windows computer that is configured to launch into Bigbox as shell. I have 4 zero-delay arcade controllers connected as the primary controllers. To compensate for the controllers activating in random order, I tick "enable all controllers" in Bigbox so all 4 work to control the UI.
I additionally run the software vJoy and Lichtknarre for handling Wii Motes connected via Bluetooth as light guns for light gun games. vJoy creates virtual joysticks as HID devices, while Lichtknarre runs as an elevated .exe and translates the wii motes to vJoy.
I've run into compatibility issues with Lichtknarre and some emulators, so I want that opened and closed alongside light gun games specifically. I'm assuming due to it being an elevated .exe, I couldn't get it to launch from the running AHK, but I found I could run it with the game as an additional application, and I could run a .bat from the running AHK and it would close Lichtknarre correctly. I've got this working completely fine.
When I close a light gun game, vJoy usually winds up stuck pointing in whatever direction it last detected, and makes the bigbox interface impossible to navigate. I've created .bat files that enable and disable the HID device using pnputil, which work fine if I run them myself elevated as administrator. The enable .bat works fine as an additional app to the emulator, but I can't get the disable .bat to run from the running AHK script. I've tried 'run example.bat', 'run *runas example.bat', I've tried creating a shortcut for the bat that is ticked to always run as admin and having the running script launch that (run example.bat - shortcut.lnk OR run *runas example.bat - shortcut.lnk), but I've been unable to get the script to properly run the .bat such that it disables the vJoy HID device.
I'm assuming I'm doing something wrong and it's not running the bat as administrator, or failing to launch at all when I use the shortcut that is set to always run as administrator.
How do I properly elevate the running script so that it launches the bat files as administrator?