Click here to Skip to main content
15,747,637 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 !!!!
Posted
Updated 10-Nov-16 17:45pm

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900