Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

RDP session scripting

Posted on 2009-07-12
3
828 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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