Remote Desktop Manager (MSTSCUI.NET) Help

MSTSCUI.NET v1.0.2497.17154 released 10/18/2006 - www.slotzero.com/mstscui/

Introduction

MSTSCUI.NET is simply a graphical interface to Microsoft's command-line Remote Desktop Connection, mstsc.exe. This application makes it easier for those who use Remote Desktop sessions often through the day. It uses the .NET Framework v1.1.

Download now!

General Use
MSTSCUI.NET.exe.config
Server Configuration XML (mstscui_servers.xml)


General Use
top

MSTSCUI.NET runs as a taskbar application to allow quick and easy access to RDP servers:

taskbar

It's generally reccommended to place an entry in your startup group so that the application launches on startup.

Simply right-click on the taskbar icon to show the menu:

menu

Select "Edit List" for a shortcut to editing your server configuration file, and "Refresh List" to reload it.


MSTSCUI.NET.exe.config
top

Use the app.config file to set the name of the server configuration file with the "ServerConfigFile" key, and set your preferred editor with the "Editor" key. It's not reccommended you change the "ServerConfigFile" key. The "Editor" key should be a fully qualified path if the editor you're using is not already setup in your path environment variables.

Below is the listing of the default app.config file:

<configuration> <appSettings> <!-- path to XML Server Configuration File --> <add key="ServerConfigFile" value="mstscui_servers.xml" /> <!-- XML File Editor to use --> <add key="Editor" value="notepad" /> </appSettings> </configuration>
Server Configuration XML (mstscui_servers.xml)
top

Use the server configuration file to setup each server.

In order to display a horizontal seperator bar on the menu, use:

<server displayname="-" />
Each server element has an attribute called "displayname" - this is the name displayed on the menu. You can be as descriptive here as necessary.
  • servername - server name or IP address
  • port - default is 3389
  • resolution - "fullscreen", or any resolution entered in this fashion: 1024x728
  • console - 1 for yes takeover console session, 0 for no do not takeover console
  • connectionfile - fully qualified path to .RDP file if you want to use one

Below is the listing of a sample server config file:

<servers> <server displayname="eventvan02 / secure"> <servername>eventvan02</servername> <port>3389</port> <resolution>1024x768</resolution> <console>0</console> <connectionfile></connectionfile> </server> <server displayname="-" /> <server displayname="vancorpbc1"> <servername>vancorpbc1</servername> <port>3389</port> <resolution>fullscreen</resolution> <console>0</console> <connectionfile></connectionfile> </server> </servers>

Download the binary here: mstscui.net.zip

Download the source here: mstscui.net_source.zip

Online help here: MSTSCUI.NET Online Help

arrow icon Click here to peruse some of the code online!

 

    Private Sub ConnectToServer(ByVal sServer As String)

        Try

            Dim sCommand As String = System.Environment.GetEnvironmentVariable("SystemRoot") & "\system32\mstsc.exe"

            System.Diagnostics.Process.Start(sCommand, GetArgumentsForServer(sServer))

        Catch ex As Exception

            MessageBox.Show(ex.Message)

        End Try

    End Sub

 

    Private Function GetArgumentsForServer(ByVal sServer As String) As String

 

        Dim sConnection As String

        Dim sPort As String

        Dim sResolution As String

        Dim arrResolution() As String

        Dim sConsole As String

        Dim sConnectionFile As String

 

        Dim sArguments As String

 

        Dim parentnode As XmlNode = doc.SelectSingleNode("servers")

        Dim servernode As XmlNode = SelectNode(parentnode, "displayname", sServer)

        Dim childnode As XmlNode

 

        For Each childnode In servernode.ChildNodes

            Select Case UCase(childnode.Name)

                Case "SERVERNAME"

                    sConnection = " /v:" & Trim(childnode.InnerText)

                Case "PORT"

                    If Trim(childnode.InnerText) <> "3389" And childnode.InnerText <> String.Empty Then

                        sPort = ":" & childnode.InnerText

                    Else

                        sPort = String.Empty

                    End If

 

                Case "RESOLUTION"

                    If InStr(UCase(childnode.InnerText), "X") > 0 Then

                        arrResolution = Split(UCase(childnode.InnerText), "X")

                        sResolution = " /w:" & arrResolution(0) & " /h:" & arrResolution(1)

                    Else

                        'anything else, default to fullscreen

                        sResolution = " /f"

                    End If

                Case "CONSOLE"

                    If CBool(childnode.InnerText) Then

                        sConsole = " /console"

                    Else

                        sConsole = String.Empty

                    End If

                Case "CONNECTIONFILE"

                    sConnectionFile = childnode.InnerText

                Case Else

                    MessageBox.Show("Unrecognized node in XML: " & childnode.InnerText)

            End Select

        Next

 

        'build argument string

        sArguments = sConnection & sPort & sResolution & sConsole

 

        Return sArguments

 

    End Function

 

    Private Function SelectNode(ByVal parentNode As XmlNode, ByVal attributeName As String, ByVal attributeValue As String) As XmlNode

        Dim node As XmlNode = Nothing

        If parentNode.HasChildNodes Then

            Dim nodeName As String = parentNode.ChildNodes(0).Name

            Dim path As String = nodeName + "[@" + attributeName + "='" + attributeValue + "']"

            node = parentNode.SelectSingleNode(path)

        End If

        Return node

    End Function