Hello,
I know this can be an idiot question but I didn't use to code with CMDs.
So lately I've been working with a PPTP VPN Connector and it works fine but yet I need to know if the connection has succeeded or failed and I'll know that from the CMD.
Here's my code:
Code:
If Not IO.Directory.Exists(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LagOPT") Then
IO.Directory.CreateDirectory(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LagOPT")
End If
IO.File.WriteAllText((System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LagOPT" & "\strOPT.pbk"), "[VPN]" & vbNewLine & "MEDIA=rastapi" & vbNewLine & "Port=VPN2-0" & vbNewLine & "Device=WAN Miniport (IKEv2)" & vbNewLine & "DEVICE=vpn" & vbNewLine & "PhoneNumber=" & host.Text)
IO.File.WriteAllText((System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LagOPT" & "\strOPT.bat"), "rasdial ""VPN"" " & "elmklbz" & " " & "asdasdasdfy" & " /phonebook:" & """" & System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LagOPT" & "\strOPT.pbk" & """")
Dim connect As System.Diagnostics.Process
connect = New System.Diagnostics.Process()
connect.StartInfo.FileName = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LagOPT" & "\strOPT.bat"
connect.StartInfo.WindowStyle = ProcessWindowStyle.Normal
connect.Start()
connect.WaitForExit()
After all that I want to copy everything from the CMD has started to a textbox before it exits, how to do so?