0
Im trying to run a .bat
file on my server through php popen command, ive struggled and finally got to the point where all the permissions are set correctly and now i can actually execute the file but i have a problem. In my server logs it displays
foo.bat: line 1: mstsc: command not found, referer: http://dev.example.com
The full code in the file is mstsc /v:192.168.1.1
I know this means that it doesn't recognize the command on centos but im not sure what to do to fix the problem.
The aim of this code is to open RDP for the user who requested it. Bear in mind that this code works perfectly locally on my windows OS using xampp but when i upload it to the server running CENTOS it doesnt work.
My question is
How do i fix this error and allow CENTOS to execute a command that opens an RDP window for the user
I want to open the file locally, with my code locally on xampp it allows me to click a button on a web page and open RDP, but when i upload it to the server it doesnt work and throws that error but thats what im trying to accomplish – Keny iron – 2017-02-28T10:49:25.370
I think I understand now. What you were trying is completely senseless, let me explain: the RDP connection must be made from a client (that has a graphical interface), but PHP on the server (which may not have a graphical interface) cannot, normally, issue commands (such as launch an application) on the clients. The only reason it works with your WAMP setup is that the client and the server are in that case the same machine. – simlev – 2017-02-28T10:58:55.967
I get you but the only reason im trying to simulate this is because its been done before by other companies, the only problem is i dont know how and ive looked around the internet and this is the closest answer that ive come up with, not going to lie theres not much help available with this subject and its proving to become a really difficult task to accomplish, i just know its doable so i want to do it. – Keny iron – 2017-02-28T11:03:55.993
Thanks for the extra information ill look more into these links and get back to you – Keny iron – 2017-02-28T11:05:42.697
Thanks for this i seriously had to take a step back and slow down for me to actually get somewhere, seen as i had no idea where to start with this i was looking in all the wrong places and have added a heap of code it that works in development but not production, exactly what i was looking for thanks for the help and patience – Keny iron – 2017-02-28T11:20:39.413