遠端連線執行對方電腦的 command mode

遠端連線執行對方電腦的 command mode

Shell 函數

http://office.microsoft.com/zh-tw/access/HA012289061028.aspx
Code:

    Winsock1.Protocol = sckUDPProtocol
    Winsock1.RemoteHost = Text1.Text
    Winsock1.LocalPort = CLng(Text2.Text)
    Winsock1.RemotePort = CLng(Text3.Text)
    Winsock1.Bind
    Me.Caption = "連線等待中"
End Sub

Private Sub Command3_Click()
    Winsock1.SendData "OpenCMD"
End Sub

Private Sub Form_Load()
    Text1.Text = "IP"
    Text2.Text = "7777"
    Text3.Text = "3333"
    Text5.Text = ""
End Sub

Private Sub Winsock1_DataArrival(ByVal BytesTotal As Long)
    Dim sVar As String
    Winsock1.GetData sVar, vbString
    Select Case Trim(sVar)
    Case "OpenCMD"
        Shell "C:\Windows\system32\cmd.exe", vbNormalFocus
        Winsock1.SendData "成功開啟命令提示字元視窗"
    Case Else
        List1.AddItem "Guest: " & sVar
    End Select
End Sub

執行過程:
開啟程式 > 互相鍵入對方IP與Port > 互相輸入對話 > 開啟命令提示字元

1.bmp

2.bmp

3.bmp