setup an automatic shortcut for RDP

al4629740
al4629740 used Ask the Experts™
on
Is there a way to make a batch file or something where it will automatically create a shortcut on the desktop for RDP with an IP address already programmed into it.

So in effect, it will help individuals who are computer illiterate to make an easy shortcut for them to login into their terminal server.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ramromconsultant

Commented:
The shortcut target is something like %windir%\system32\mstsc.exe  "D:\Documents and Settings\Administrator\Desktop\xxx.RDP" /v:192.168.2.2

mstsc.exe /? shows you the command line options.

Automatically creating it is another matter. What do you want to trigger the creation>
Commented:
Yes the easy way is open MStsc, enter all your settings, user, password, screen size etc. etc., tick "remember password" if that fits with your security requirements.
Save-As to an RDP file on the desktop.

Double click to run it.

Or save it elsewhere and create a shortcut to the RDP file.

The RDP files are just text files if you look at them in Notepad so can be created in lots of different ways from scratch if needed, e.g. here is one of mine:

screen mode id:i:1
desktopwidth:i:1440
desktopheight:i:900
session bpp:i:16
winposstr:s:0,3,374,39,1656,1057
full address:s:servername.org.co.uk
compression:i:1
keyboardhook:i:2
audiomode:i:0
redirectdrives:i:1
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:0
displayconnectionbar:i:1
autoreconnection enabled:i:1
username:s:myusername
alternate shell:s:
shell working directory:s:
disable wallpaper:i:1
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:1
disable cursor setting:i:0
bitmapcachepersistenable:i:1
use multimon:i:0
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:2
allow font smoothing:i:0
allow desktop composition:i:0
redirectclipboard:i:1
redirectposdevices:i:0
redirectdirectx:i:1
authentication level:i:2
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:1
use redirection server name:i:0
drivestoredirect:s:*

Author

Commented:
what is mstsc?

Do I save this as a batch file?
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Commented:
MSTSC is MSTSC.exe, the RDP / terminal server client program.

As above you could just save the above text as a .RDP file and then that is what the users run.

Or easier like I said, launch the RDP program (from menu or start button, run, and type mstsc

Then enter all your params, and choose Save As to create an RDP file.

Is that what you want, one static RDP session based on known settings, or do you want it based on something else?

Steve

Author

Commented:
If I setup the RDP session to automatically run a program, can I set it up to automatically close the session after the user closes the program?

Commented:
Hey Steve, I hope you are well!!
Would you mind that I add some of my grains of salt here?

Cheers,
Rene

Commented:
Like you need to ask... been out all day, go for it.

Author

Commented:
I would appreciate it

Commented:
Sorry I was not able to get back to you before now.
I was about to make a script that would automatically generate the RPD files for your LAN's PC.

Glad you found your solution.

Cheers,
Rene
ramromconsultant

Commented:
"The RDP files are just text files" well - almost. The password is magically saved - obviously not in the text file.

Commented:
There have been various different versions of how passwords have been stored over the years with different OS's and security concerns.  At one stage they were stored in the RDP file, encrypted etc.

Rene, if you have a good way to create RDP connection with passwords if needed would be interested anyway!

One link re: password structure of RDP files: http://www.remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/

Author

Commented:
Is it possible to have an RDP script that has the password in it, so that they don't have to enter it each time?  I would like to know, in fact I will open a new question so please look for it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial