Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to set up a batch script to login to a specific server as multiple users via Remote Desktop Connection. On Remote Desktop Connection I edit the Computer and Username then save the credentials in a .rdp file. However, when I call the .rdp files in the script they only use the user credentials of the previously logged in user i.e. user1 will be logged in 3 times instead of user1, user2, user3.

In the .rdp files that I saved I don't see any entries for username or password and manually trying to add them doesn't do anything. I'm working with RDC version 6 on Windows Server '03.

Any help or suggestions would be great!

share|improve this question
add comment

2 Answers

Starting with Remote Desktop Client 6, the credentials are stored in the Windows user account. You can view them with NetPass and modify using Credential Management API.

share|improve this answer
    
The old format still works, you just need to use the CryptProtectData API call on the password before you save it to the file, and the login is tied to the user account, so it can't take the file off the computer. –  Scott Chamberlain Mar 12 '13 at 20:53
add comment

Username and passwords are not stored in the rdp file.

They are stored somewhere else on your OS, on Windows vista or above they are stored on cmdkey

To view your current credentials go to command prompt and type cmdkey /list

From the link you can learn how to delete them as needed.

From your script you will first need to delete the credential for the rdp server then add the new one.

cmdkey /delete:rdpserver.domain.com

then

cmdkey /add:rdpserver.domain.com /user:Kate /pass:passme

OR add the credentials then delete at the end of your script

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.