Remote desktop from EXcel sheet

Hi,

I have list of servers in Excel2010 sheet instead of typing MSTSC in run command, I needs to take RDP of the server from the excel sheet.

Please assist on this.

IP                     servername
192.168.1.10    server1
192.168.1.11    server2
192.168.1.12    server3
192.168.1.13    server4
192.168.1.14    server5

August 13th, 2015 11:20am

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        Dim RetVal As Variant
        If Target.Cells.Count = 1 Then

           If Not Intersect(Target, Range("B2:B999")) Is Nothing Or Not Intersect(Target, Range("C2:C999")) Is Nothing Then
                If Not IsEmpty(Target) Then

                     RetVal = Shell("cmdkey /generic:""" & Target & """ /user:""" & Target.Offset(0, 1) & """ /pass:""" & Target.Offset(0, 2) & """", 1)
                     RetVal = Shell("c:\Windows\System32\mstsc.exe /admin /v:" & Target, 1)
                End If
            End If
        End If
    End Sub

Please try this code,

IP's of servers are located in column B and C, then Username and Passwords are in column D and E.

After double clicking the IP the correct username and password credentials are stored, then RDP is launched.

Free Windows Admin Tool Kit Click here and download it now
September 9th, 2015 3:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics