Nar*_*ser 6 windows windows-services
问题:有没有办法让程序在没有创建Windows服务的长期痛苦任务的情况下运行,或者是否有简单的方法来创建简单的服务?
信息:我正在为大学开展一个小项目,这是一个简单的分布式处理程序.我将利用目前完全闲置的校园电脑,制作我自己的小型超级计算机.但要做到这一点,我需要在我的目标机器上运行客户端.
通过互联网上的一点点,我发现我需要的是一项服务,我也发现这并不像制作计划任务或将.bat文件放入启动文件夹那么简单.
我不需要太多.如果我可以让它调用"python cClient.py"我完全设置.是否有捷径可寻?喜欢在注册表中添加一些键在哪里?或者我是否必须完成微软为建立服务所做的整个歌舞仪式?
小智 9
如果您已经拥有希望作为服务运行的可执行文件,则可以使用操作系统内置的"sc".Microsoft详细说明了此过程:http://support.microsoft.com/kb/251192
example: sc create "My Service" c:\temp\executable.exe
Run Code Online (Sandbox Code Playgroud)
C:\ Users\somebody> sc create
DESCRIPTION: Creates a service entry in the registry and Service Database. USAGE: sc <server> create [service name] [binPath= ] <option1> <option2>...
OPTIONS: NOTE: The option name includes the equal sign.
A space is required between the equal sign and the value. type= <own|share|interact|kernel|filesys|rec>
(default = own) start= <boot|system|auto|demand|disabled|delayed-auto>
(default = demand) error= <normal|severe|critical|ignore>
(default = normal) binPath= <BinaryPathName> group= <LoadOrderGroup> tag= <yes|no> depend= <Dependencies(separated by / (forward slash))> obj= <AccountName|ObjectName> (default = LocalSystem) DisplayName= <display name> password= <password>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12184 次 |
| 最近记录: |