正在运行的进程,当在vb.net隐藏命令窗口 [英] Hiding command window in vb.net when running processes

查看:726
本文介绍了正在运行的进程,当在vb.net隐藏命令窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有这样的code

If I have this code

    ' 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()

我能做些什么,使这个在执行时命令窗口不出现?
谢谢!

What can I do to make the command window NOT appear when this is executed? Thanks!

推荐答案

您可以通过设置CreateNoWindow为真做到这一点,这可能有助于<一个href=\"http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.createnowindow.aspx#Y0\"相对=nofollow> MSDN

You can do it by setting CreateNoWindow to true, This may help MSDN

Proc.StartInfo.CreateNoWindow = true

这篇关于正在运行的进程,当在vb.net隐藏命令窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆