1

我正在 VB.net 中编写一个创建和调用批处理文件的应用程序。我希望这些批处理文件隐藏运行,但由于文件没有快捷方式,我需要在批处理代码本身中设置它。我该怎么做?

4

1 回答 1

2

链接中的 vbs 脚本看起来不错,但是如果您从 VB 应用程序调用批处理文件,那么您可以隐藏运行批处理文件:

Dim p As New Process()
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.Arguments = "/C mybatchfile.bat"
p.StartInfo.CreateNoWindow = True
p.StartInfo.UseShellExecute = False
p.Start()
p.WaitForExit();// this line waits for the batch to finish, remove if you want to start the batch and continue your app while it runs.

马丁

于 2012-02-24T19:07:14.707 回答