0
A
回答
1
無論最終調用CreateProcess
需要通過CREATE_NO_WINDOW
進程創建標誌。
該進程是在沒有控制檯窗口的情況下運行的控制檯應用程序。因此,應用程序的控制檯句柄未設置。
究竟如何最好地從腳本實現這一點取決於您使用的腳本語言。
0
您可以將其作爲服務的一部分運行,但這需要它具有自我安裝代碼或手動安裝。
另一種方法是編寫一個Windows窗體應用程序,但沒有表格,請執行以下操作:
using System.Windows.Forms;
using System.Diagnostics;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
string ApplicationPath = @"c:\consoleapplication.exe";
// Create a new process object
Process ProcessObj = new Process();
// StartInfo contains the startup information of
// the new process
ProcessObj.StartInfo.FileName = ApplicationPath;
// These two optional flags ensure that no DOS window
// appears
ProcessObj.StartInfo.UseShellExecute = false;
ProcessObj.StartInfo.CreateNoWindow = true;
// If this option is set the DOS window appears again :-/
// ProcessObj.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
// This ensures that you get the output from the DOS application
ProcessObj.StartInfo.RedirectStandardOutput = true;
// Start the process
ProcessObj.Start();
// Wait that the process exits
ProcessObj.WaitForExit();
}
}
}
你可以調用你的腳本這個應用程序。
相關問題
- 1. .Net無法啓動控制檯的控制檯應用程序
- 2. 有沒有減少控制檯Java應用程序啓動時間的方法?
- 3. 有沒有辦法從WinForms/WPF應用程序啓動/打開控制檯?
- 4. C#運行外部控制檯應用程序,並沒有ouptut?
- 5. 啓動後臺Win32控制檯應用程序
- 6. 在後臺啓動我的控制檯應用程序
- 7. 看到控制檯輸出沒有控制檯?
- 8. 在WF4控制檯應用程序沒有移動到下活動 - 購物車
- 9. 在用戶登錄之前啓動控制檯應用程序
- 10. 無法使用xCode 4.4啓動控制檯應用程序
- 11. 從控制檯應用程序啓動ASP.NET Core 1應用程序
- 12. 啓用控制檯應用程序的輸出到腳本
- 13. 控制檯應用程序:打印到控制檯溢出
- 14. 從Mac OS X控制檯啓動iOS應用程序
- 15. 啓動Windows控制檯應用程序參數
- 16. 如何確定如何啓動控制檯應用程序?
- 17. 啓動單一的控制檯應用程序
- 18. 在應用程序啓動時最小化控制檯C#
- 19. 添加清單後無法啓動控制檯應用程序
- 20. 重新啓動一個java控制檯應用程序代碼
- 21. C#重新啓動控制檯應用程序
- 22. 服務不會啓動控制檯應用程序
- 23. 簡單的Visual Studio控制檯應用程序無法啓動
- 24. c#啓動控制檯應用程序在贏取形式
- 25. 自動重啓linux控制檯應用程序
- 26. 重新啓動Java控制檯應用程序
- 27. 從MenuStrip啓動控制檯應用程序(Visual C#)
- 28. 從gui前端啓動控制檯應用程序
- 29. WindowLess WinForm或控制檯應用程序來啓動.bat文件?
- 30. 控制檯應用程序從ASP.NET Webform啓動後崩潰
我使用java腳本或VB腳本 – 2012-01-17 10:57:07