I want to change focus window from browser to another app using PHP, on Windows local machine.
I want to make a scenario, like: User will access via browser, input some code. If the code is correct then PHP will change focus window from browser to Microsoft Word (for example). Only change the focus window, Ms Word already started.
Thinking of using system(), exec(), or shell_exec() in php to run a .bat file, but still didn't work.
swith-to-word.bat
echo new ActiveXObject("WScript.Shell").AppActivate("Microsoft Word"); > tmp.js
cscript //nologo tmp.js & del tmp.js
php
system('cmd /c C:\Users\User\Sites\admin\public\commands\swith-to-word.bat');
I want to run this scenario only in server locally, won't be accessed by another client.
Anyone has suggestions to this scenario? Thank you in advance