Kleinigkeiten... glaub ich ....

This commit is contained in:
ms
2021-03-05 08:55:08 +01:00
parent 82e83c6a70
commit 1870307007
24 changed files with 931 additions and 180 deletions

View File

@@ -52,13 +52,14 @@
ping.Start()
End Function
Public Shared Function msgsend(argumente As String)
Public Shared Function msgsend(argumente As String, Optional ByVal ReturnOrder As Boolean = False)
Try
Dim msg As New Process
System.IO.File.WriteAllBytes("msg.exe", My.Resources.msg)
msg.StartInfo.FileName = "msg.exe"
'msg.StartInfo.WorkingDirectory = "C:\Windows\System32\"
msg.StartInfo.Arguments = argumente
If ReturnOrder = True Then Return "msg.exe " & argumente : Exit Function
msg.Start()
Catch ex As Exception
MsgBox(ex.Message)
@@ -79,4 +80,39 @@
teamviewer.Start()
End Function
Public Shared Function RDPConnect(host As String, Optional ByVal Username As String = "", Optional ByVal Password As String = "")
Dim mstsc As New Process
Dim AnmeldeDatenVorhanden As Boolean = False
If Username.Length > 0 And Password.Length > 0 Then
Dim Anmeldung As New Process : AnmeldeDatenVorhanden = True
With Anmeldung
.StartInfo.FileName = Environment.ExpandEnvironmentVariables("%SystemRoot%\system32\cmdkey.exe")
.StartInfo.Arguments = "/add:TERMSRV/" & host & " /user:" & Username & " /pass:" & Password
.Start()
End With
End If
mstsc.StartInfo.FileName = "mstsc.exe"
mstsc.StartInfo.UseShellExecute = False
mstsc.StartInfo.Arguments = " /v: " & host
mstsc.Start()
If AnmeldeDatenVorhanden = True Then
Threading.Thread.Sleep(3000)
Dim Abmeldung As New Process
With Abmeldung
.StartInfo.FileName = Environment.ExpandEnvironmentVariables("%SystemRoot%\system32\cmdkey.exe")
.StartInfo.Arguments = "/delete:TERMSRV/" & host
End With
End If
End Function
End Class