如何从这段代码中隐藏CMD控制台?
如何在此代码中隐藏控制台?目前,每次运行此代码时都会显示 cmd 控制台。
protected override void OnStart(string[] args)
{
String applicationName = "cmd.exe";
// launch the application
ApplicationLoader.PROCESS_INFORMATION procInfo;
ApplicationLoader.StartProcessAndBypassUAC(applicationName, out procInfo);
}
如何从这里执行 *.bat 文件?我可以简单地用“xxx.bat”替换“cmd.exe”吗?
How to hide the console from within this code? Currently the cmd console is shown everytime I run this code.
protected override void OnStart(string[] args)
{
String applicationName = "cmd.exe";
// launch the application
ApplicationLoader.PROCESS_INFORMATION procInfo;
ApplicationLoader.StartProcessAndBypassUAC(applicationName, out procInfo);
}
How can I execute a *.bat file from here? Can I simply can substitute the "cmd.exe" with "xxx.bat"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在代码中添加系统引用;
然后使用此代码隐藏 CMD 窗口并运行。
Add a System Reference to the code;
Then use this code to Hide the CMD Window and run.
尝试使用 Process 类而不是 ApplicationLoader(我从未听说过该类,它是自定义类吗?)
代码示例:
Try it with the Process Class instead of the ApplicationLoader (I´ve never heard of that class, is it a custom class?)
Code Example: