0
A
回答
0
参考(在C#不过):
How to install a windows service programmatically in C#?
//Installs and starts the service
ServiceInstaller.InstallAndStart("MyServiceName", "MyServiceDisplayName", "C:\PathToServiceFile.exe");
//Removes the service
ServiceInstaller.Uninstall("MyServiceName");
//Checks the status of the service
ServiceInstaller.GetServiceStatus("MyServiceName");
//Starts the service
ServiceInstaller.StartService("MyServiceName");
//Stops the service
ServiceInstaller.StopService("MyServiceName");
//Check if service is installed
ServiceInstaller.ServiceIsInstalled("MyServiceName");
相关问题
- 1. 以编程方式安装Windows服务
- 2. 以编程方式安装Windows服务
- 3. 如何在VB.net中以编程方式关闭窗口?
- 4. MongoDB窗口服务安装
- 5. 如何以编程方式安装.ipa
- 6. 如何以编程方式访问android中的安装程序服务?
- 7. VB.NET以编程方式关闭模式窗口
- 8. 如何重新启动我的窗口服务以编程方式在c#.net
- 9. 无法以编程方式安装Windows服务
- 10. 在窗口上安装Git服务器
- 11. 如何以编程方式从服务
- 12. 从服务器安装IPA文件并以编程方式安装
- 13. 如何在android中以编程方式打开SMS窗口?
- 14. 如何以编程方式在Qt窗口中心设置QWidget?
- 15. 如何以编程方式在LabView中切换活动窗口
- 16. 如何以编程方式在C#中启动chkdsk GUI窗口?
- 17. 以编程方式调整Traitsui窗口
- 18. 以编程方式在WPF中创建窗口窗体
- 19. 窗口服务安装问题
- 20. 如何以编程方式更改wpf窗口中的标题?
- 21. 如何以编程方式在窗口上调用Aero Peek?
- 22. 以编程方式在ProjectInstaller上设置窗口服务的版本
- 23. 在安装MyFbApp.apk之前以编程方式安装facebook.apk
- 24. 以编程方式安装在棉花糖上的APK安装
- 25. 以编程方式在服务器
- 26. VB.net Windows服务未安装
- 27. 以编程方式安装android事件
- 28. 安装Android APK以编程方式
- 29. 以编程方式安装字体
只需使用Process类运行InstallUtil.exe。这通常是一个相当糟糕的主意,因为这需要管理员权限和UAC提升。 –