Skip to content
Advertisement

Command Not Found CentOS | .bat File

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 recognise 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

Advertisement

Answer

I feel like this is exactly what you’re after

http://www.jjclements.co.uk/2010/02/21/rdp-hyperlink/

It allows you run a bat file that opens windows RDP without needing to write a single line of server code. Take a look its pretty good!

Advertisement