Env*_*vin 5 vb.net asp.net command-prompt
如果我有这个代码
' Send file to Unix server via pscp
Dim Proc As New System.Diagnostics.Process
Proc.StartInfo = New ProcessStartInfo("C:\Windows\System32\cmd.exe")
Proc.StartInfo.Arguments = "/C C:\pscp.exe -pw " & PASSWORD & " " & physicalFolder & "\" & UNIXSCRIPTNAME & " " & unixLogin
Proc.StartInfo.RedirectStandardInput = True
Proc.StartInfo.RedirectStandardOutput = False
Proc.StartInfo.UseShellExecute = False
Proc.Start()
' Allows script to execute sequentially instead of simultaneously
Proc.WaitForExit()
Run Code Online (Sandbox Code Playgroud)
执行此操作时,我该怎么做才能使命令窗口不出现?谢谢!
您可以通过将 CreateNoWindow 设置为 true 来实现,这可能对MSDN有所帮助
Proc.StartInfo.CreateNoWindow = true
Run Code Online (Sandbox Code Playgroud)