Create rdp file with php to download






















I've got a few servers that I'd like to connect to every so often to run a program. However, to make it easier, I'd like to make a PHP script connect to each of them via remote desktop and run each of them. Is this possible? If so, where should I start? An example would be lovely. In theory you could implement a PHP script that could communicate with a server in the RDP protocol, but I certainly wouldn't want to try to build a script that can do anything meaningful, as RDP is built to expose a remote machine's user interface to the connected client and PHP is built first and foremost to manipulate text.

If you want a PHP script to remotely control another computer, then SSH is a far more sensible option, as PHP could easily connect to the remote cmputer's CLI and issue commands to the server via shell commands, which are textual and therefore easily generated with PHP.

On the other hand, interfacing with the remote computer with RDP would be extremely difficult. Just think about clicking on an icon to get a directory listing for a start. You'd first have to determine where the mouse pointer is, whether the icon you want to click is visible and if so where its bounding box is relative to the mouse pointer.

You'd then have to issue commands to move the mouse pointer to within the bounding box, then check that the mouse pointer is in the right place a local or other remote user might be moving the mouse around and then issue a pair of clicks with a short delay between them. I think it be best if the servers were running a service that you could connect to. For example they could be running a web service e.

You could then connect to that web address through port 80 which could run the applications. Of course you have security concerns, but you should be able to configure them so that they only accept requests from certain IPs. Alternatively you could make the script password-protected.

The easiest way to do this while somehow staying within your requirements, is to install one of the software linked below on the host machines.

Then you would need an API to connect:. In PHP all you would need is something as simple as exec "rexec Install WAMP on the hosts and then have php run the commands on them. So it would be something like php to php where ur client would call something like curl I'm working on such a thing for my web based hosts access.

If I get something done, I'll be happy to share with you. Honestly, you're best bet would be C. This probably isn't what you want to hear, but it's extremely trivial to make an rdp client in that language.

Your email address will not be published. Skip to content Advertisement. Support us Winaero greatly relies on your support. Leave a Reply Cancel reply Your email address will not be published. We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. Read More Do not sell my personal information. Close Privacy Overview This website uses cookies to improve your experience while you navigate through the website.

Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. Normally, you don't necessarily need to use any server side scripting language like PHP to download images, zip files, pdf documents, exe files, etc.

If such kind of file is stored in a public accessible folder, you can just create a hyperlink pointing to that file, and whenever a user click on the link, browser will automatically downloads that file. Clicking a link that points to a PDF or an Image file will not cause it to download to your hard drive directly.

It will only open the file in your browser. Further you can save it to your hard drive. In the Actions pane for the program or selected programs, click Create. If you selected multiple programs, the settings described in the rest of this procedure apply to all of the selected programs. A separate. When the wizard is finished, the folder where the. You can confirm that the.



0コメント

  • 1000 / 1000