04-11-22, 10:23 AM
وعليكم السلام
كود :
Dim p As Process = New Process()
p.StartInfo.FileName = "PowerShell.exe"
p.StartInfo.Arguments = "اكتب الكوماند الذي تريده هنا"
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
p.StartInfo.UseShellExecute = False
p.StartInfo.CreateNoWindow = True
p.StartInfo.RedirectStandardError = True
p.Start()
p.WaitForExit()
Dim ErrorText As String = p.StandardError.ReadToEnd()
MsgBox(p.ExitCode)
If ErrorText <> "" Then
MsgBox(ErrorText)
End If