如何从PHP运行窗口服务器上的bat文件 [英] How to run bat file on window server from PHP

查看:138
本文介绍了如何从PHP运行窗口服务器上的bat文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从php脚本在窗口服务器上运行bat文件。

我把我的bat文件放在窗口服务器上的C:\\\\script \ test.bat下并尝试使用来自php脚本的exec()和system()。但是服务器上什么也没出现。谢谢!!!!



我的尝试:



我想从php脚本在窗口服务器上运行bat文件。

我将我的bat文件放在窗口服务器上的C:\\\\script \ test.bat下,并尝试使用exec()和来自php脚本的system()。但是服务器上什么也没出现。谢谢!!!!

I want to run bat file on window server from php script.
I put my bat file under C:\test\script\test.bat on window server and tried to use exec() and system() from php script. But nothing is coming out on server. Thanks !!!!

What I have tried:

I want to run bat file on window server from php script.
I put my bat file under C:\test\script\test.bat on window server and tried to use exec() and system() from php script. But nothing is coming out on server. Thanks !!!!

推荐答案

你不能。这样做也会带来巨大的安全风险。



可以使用WMI(我不知道你是否可以从php访问它)但过程你登录到服务器上的控制台的任何用户都不会看到启动。如果您启动显示任何类型用户界面的内容,则任何人都无法看到它并与之交互。
You can't. Doing so would also be a HUGE security risk.

It's possible to do using WMI (I have no idea if you have access to it from php) but the process you launch will not be visible to any user logged into the console on the server. If you launch something that shows any kind of user interface nobody will be able to see it and interact with it.


这篇关于如何从PHP运行窗口服务器上的bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆