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

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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
JohnnyBCJAuthor Commented:
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.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

JohnnyBCJAuthor Commented:
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.
JohnnyBCJAuthor Commented:
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.
JohnnyBCJAuthor Commented:

 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!
So we are sort of boardering on a completely different set of questions here and I can't say that I'm an expert in the SBS platform, but I will try to answer your question...

From the perspective of 'can you do it' yes, you should be able to setup SBS to host web content.  However you do need to be concerned about security.  From a security perspective, I would be very careful what you expose to the internet, but since it sounds like you have RDP exposed to the internet, maybe that isn't an issue in your case (personally I wouldn't risk doing that).  The safest way to lock these things down would be to keep them internal and require users to VPN into the network to use them.  If you do have to host these things to the outside world, then I would do a few things...
1) Consider hosting the web services on a port other than port 80 so that it doesn't look like a public website
2) if you do end up hosting on port 80, use a robots.txt file or similar to avoid being searched by search engines (
3) host your services under something like http://IPAddress/services/app123/myservice.aspx  and then lock down the permissions on the site so that people cannot browse directories and don't put links over to the service (this is sort of a security through obscurity kind of measure but if attackers don't know the service is there they will be a lot less likely to try to hack it)
4) Implement security on the service so that you are running over SSL and have some sort of authentication

I know there is lots of content out there on the web and probably on experts exchange on best practices for setting up and hosting web applications and services in a secure manner; and I obviously can't repeat it all here.  

Of course, beyond just getting your server setup to host the service, you may also have to open (or forward) a port on your firewall depending on what yoru deployment scenario looks like.  So that might be why you can't currently expose the page to the outside world.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnnyBCJAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Remote Access

From novice to tech pro — start learning today.