Solved

RDP session scripting

Posted on 2009-07-12
3
820 Views
Last Modified: 2013-11-21
Is there a way to script an RDP session? We have a farm of Terminal Servers and there is an application on one Terminal Server that for various reasons can't be installed on any other Terminal Servers.  Is there any way that I can script an RDP session from the other Terminal Servers that would RDP into the 'special' TS and automatically run the program so that it would be transparent for the user e.g. they would just click on an icon and after a few flashes they would be getting the splash page of the  target program running on the 'special' Terminal Server and when they exited the program it would take them back to their own TS.  I know about application virtualization and the products for it but that's not on for this situation. Home made solutions are all that's allowed by this budget.  The servers are running Windows 2000 TS.
0
Comment
Question by:lineonecorp
  • 2
3 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 300 total points
ID: 24836091
Hmm - I can't say for certain if this is possible with W2k, but it is with W2k3.
Click Start->Run->mstsc <Enter>

Now, you would adjust the session as needed (may have to click Options first).
From the Programs tab, there's a check mark to 'run this program' on connection - enter the application there after checking the box.
Click OK (after making any other needed adjustments).

Now click Save As and save it in the windows\system32 folder as "special.rdp"

Now create a desktop shortcut that launches a single-line batch file containing:

where SERVERNAME is the 'special' server's computer name...


@mstsc "%systemroot%\system32\special.rdp" /console /v SERVERNAME

Open in new window

0
 

Author Closing Comment

by:lineonecorp
ID: 31602646
Great little trick. I can see a lot of uses for this. Thanks.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 24838262
Glad I could help.
I use that batch file quite often...
Mine is a bit longer and targeted for different scenarios - perhaps you'll find use for it as well.
I've named it cnx.cmd, also stored in my system32 folder, so I can click Start->Run-> cnx servername <Enter>
which allows the servername as a parameter - different servers provide different scenarios (just an example - can be broadened to include multiple servers):
@echo off

set srv=%1
 

If [%srv%]==[] goto usage

If /i [%srv%]==[server1] set parm=/console
 

mstsc %systemroot%\system32\nonconsole.rdp %parm% /v %srv%

Open in new window

0

Featured Post

Too many email signature updates to deal with?

Do you feel like you are taking up all of your time constantly visiting users’ desks to make changes to email signatures? Wish you could manage all signatures from one central location, easily design them and deploy them quickly to users? Well, there is an easy way!

Join & Write a Comment

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now