Asp.net 运行进程时在vb.net中隐藏命令窗口
如果我有这个密码Asp.net 运行进程时在vb.net中隐藏命令窗口,asp.net,vb.net,command-prompt,Asp.net,Vb.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 & " " &am
' 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()
执行此命令时,如何使命令窗口不出现?
谢谢 您可以通过将CreateNoWindow设置为true来实现,这可能会有所帮助
CreateNoWindow=True
对我不起作用,下面的工作非常完美:
Proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
这正是我所需要的。谢谢
Proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden