3

edit Figured it out, instead of trying to launch it via mstsc.exe file.rdp, I launch file.rdp instead and it works just fine. end edit

Ok I am working on a c# program, part of it is generating its own .rdp file that will automatically connect with all information provided when it is generated.

When I try to launch the rdp file from command line I get that it's not a vaild connection profile. If I double click it in windows it opens up, connects and logs in. So I know the password hashes that its generating are correct. I don't understand why its not valid via command line.

Here is whats being generated in the .rdp file

"full address:s:" + IP
"username:s:" + User
"domain:s:" + Domain
"password 51:b:" + Pass
"port:i:" + Port
"screen mode id:i:1"
"desktopwidth:i:800"
"desktopheight:i:600"
"session bpp:i:32"
"auto connect:i:1"
"autoreconnection enabled:i:1"
"compression:i:1"
"keyboardhook:i:2"
"audiomode:i:2"
"redirectdrives:i:1"
"redirectprinters:i:1"
"redirectcomports:i:0"
"redirectsmartcards:i:0"
"displayconnectionbar:i:1"
"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"
"bitmapcachepersistenable:i:1";
Tsukasa
  • 6,342
  • 16
  • 64
  • 96
  • How are you launching it from your code? – Joe Oct 04 '11 at 23:03
  • Also, you can remove all but the first 5 lines to troubleshoot if it's something weird in the extra options. – Joe Oct 04 '11 at 23:03
  • I figured it out, I was trying to launch it via mstsc.exe file.rdp /admin. If i just run the rep file directly it works fine. Maybe I miss understand what mstsc.exe wants as a connection profile? – Tsukasa Oct 05 '11 at 00:46

1 Answers1

2

Figured it out, instead of trying to launch it via mstsc.exe file.rdp, I launch file.rdp instead and it works just fine.

Tsukasa
  • 6,342
  • 16
  • 64
  • 96