在本地窗口中使用PHP切换焦点应用程序
我想在Windows Local Machine上使用PHP将焦点窗口从浏览器更改为另一个应用程序。
我想制作一个场景,例如: 用户将通过浏览器访问,输入一些代码。如果代码正确,则PHP将将聚焦窗口从浏览器更改为Microsoft Word(例如)。仅更改焦点窗口,MS Word已经启动。
考虑在PHP中使用System(),exec()或shell_exec()运行.bat文件,但仍然无法使用。
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 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论