We help IT Professionals succeed at work.

How can I run the Remote Desktop Connection hidden or not display any error messages?

Last Modified: 2012-05-07
When certain conditions are met, the program I have created runs a RDP file. The entire purpose of this RDP file is to run 1 single program on the terminal server and once that program has completed, to shut down the RDP connection (not coded yet). It is very possible (and likely) that the client may already be logged into the same terminal server through RDP (using a different user name than what is in the RDP file).

I currently am trying to figure out the best way for the following:

Is it possible to run the RDP file hidden or at least minimized/not focused so that it would not affect what the client is doing - making the client unaware this is happening would be best.

What is the best way to terminate the RDP connection after the program is completed?
My current setup allows the session to last 1 minute before it displays a warning that you have 2 minutes to save your files before the session ends. I would prefer not to see this error message at all and after the 1 minute is up just end the session and close down that particular RDP.

I've created both parts of this program:
The program that runs the RDP from the client when certain conditions are met and the program that the RDP runs after logging into the terminal server.

I want this to all happen in a way that the client is completely 100% unaware that it is happening. What is the best way to go about this?
Watch Question

Does the application have to run through RDP?  Or could you use a different method such as RPC or remoting to trigger the application?  Just thinking that some other method might be an esier way to make this more transparent to the user and avoid consuming all the resources that are required on the server when a client establishes a remote desktop session.


I've never really thought of a different way of doing this but I'm definitely up for suggestions.

The purpose of using RDP is to simply upload a .txt file that contains 1 line to the server. Nothing more, nothing less. After the transfer is completed, I want to end the connection.

I've also thought about having a FTP on the server but my worries there are about security and exploits if someone by chance finds out the user name and password for the FTP. I do know that you can set permissions to the folder(s) in the FTP but it still worries me. At least through RDP after 1 minute their session would be disconnected. I wonder if there is such a time limit that you can set on a FTP before the user gets disconnected?

How would I be able to setup a RPC for this? Come to think about it, there must be an easier (and better) way to set this up than by RDP.

If all you are trying to do is put a file onto the server, I would use FTP, a windows share, or a post to a website.  In fact, if you are worried about security, you could use HTTPS on the website.

I guess I'm not quite sure how having someone find out the user name and password for an FTP server or website would be any more of a security risk than having them find out the user name and password for an RDP connection?  Either way if it's something you have stored on the client side you would want to store it with some form of encryption so it at least isn't 'easy' to decipher.

If you are trying to trigger something to run on the server, I would recommend a remoting call or web service call.  If you're on the newer versions of .NET you can even use the built-in security features of web services.

Long story short, I don't think automating RDP is the best or easiest way to get what you want accomplished.


Well in all reality, all I'm trying to do is simply get a string (at a max of 16 characters) from the client to the windows 2003 server that they currently use to connect to by remote desktop connection.

I would love to figure out how to have it setup via remote call. I think that would be the best. Like most things, it's easier said than done.

For that I would definitely recommend web services.  To put in layman's terms, web services are web pages that perform a specific function (rather than having a user interface) and you talk to them via XML.  The .NET framework has a robust set of objects that make creating the web services and using them quite simple.  You basically develop a method (presumably with the string as the parameter) and mark it as a web service method, then deploy it to IIS on the server.  The web service method can do whatever you want it to do to put the sting information whereever you need it.  Your client then connects to and calls the method.

Here are some starter articles if you need them, but your best bet is to look up information that is specific to whatever version of .Net you are working in since the specifics of web services have changed a bit between 1.1 and 3.5.




I've made web services in the past but I've only ever used them in development (in class so to speak). In college we never actually took the web service outside of a visual studio project. I have the web service created (and tested). Now I need to figure out what needs to be done to deploy it to IIS on the server ( I got to check if IIS is even installed on the server). Then I need to be able to figure out how to connect to the server from outside. Oh the wonderful things you don't learn in college :-)

Yeah.  They ought to have a required course "Deployment and Troubleshooting" to teach you how to get it from your dev PC into a 'real' environment.  Good luck with it.



 The web service method can do whatever you want it to do to put the sting information whereever you need it.  Your client then connects to and calls the method.

Is there a way to setup the SBS so that one of the clients can go to it's IP address/page.aspx and go to a specific web page hosted on the SBS?If so what would be needed to set this up? I thought that the SBS would only be able to host an intranet (or internal website) and not one that a client would be able to connect to from outside the network via  http://IPAddress/index.aspx

Please clear this up for me. Thanks!
Unlock this solution and get a sample of our free trial.
(No credit card required)


Thank you for your help. I greatly appreciate it. People like you make Experts Exchange exactly what they are. I applaud you.

I've changed my mind on how to set this up. I managed to set this up through *drum roll please*... email. 2 Ends, one for the client that sends the info and the other constantly checks the email and if certain conditions are met, it reads the email and creates the file.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.