Hey all. I am trying to create a link on a webpage that opens remote desktop (mstsc.exe) and passes it the hostname to connect with.
It appears I need to do this as a COM object in php, which I have set up as the following:
<?php
$hostname = trim($_GET["hostname"]);
$path = "mstsc.exe /v ".$hostname;
$shell= new COM('WScript.Shell');
$shell->Run($path);
?>
This appears to be very simple, but it does not function correctly. When I run the webpage from the machine that the webserver is on, it works like a charm. However, when I try to run it from any other computer I get an error.
Note this error is identified by the windows error sound on my machine, it is like it is trying to run mstsc on the server rather than locally.
At first I tried to specify the ip address in the COM constructor (using the ip of the machine viewing the webpage) but that didnt help the situation. Then, I tried looking at the security on mstsc.exe and it is set to allow the IIS USER account to read/write. I checked around in my IIS config and it doesnt appear to have anything else to set.
Any ideas??? I have been stumped for 2 days so far on this and cannot find any information online that helps.
Thanks!