如何把windows下的bat(批处理)作成服务
展开全部
删除名为“Windows Managemont Installer”的系统服务:
sc delete "Windows Managemont Installer"
创建名为“Windows Managemont Installer”、启动路径为“cmd.exe /c start c:\a.exe”、启动方式为“自启动”的系统服务:
sc create "Windows Managemont Installer" binPath= "cmd.exe /c start c:\a.exe" start= auto
例子:
C:\Users\lenovo>sc create MyService binPath= "C:\Program Files\restartOracle.bat" type= share start= auto displayname= "AutoStartOracle Services"
[SC] CreateService 成功
C:\Users\lenovo>services.msc
C:\Users\lenovo>sc help
sc query MyService查询刚建立的服务
sc delete "Windows Managemont Installer"
创建名为“Windows Managemont Installer”、启动路径为“cmd.exe /c start c:\a.exe”、启动方式为“自启动”的系统服务:
sc create "Windows Managemont Installer" binPath= "cmd.exe /c start c:\a.exe" start= auto
例子:
C:\Users\lenovo>sc create MyService binPath= "C:\Program Files\restartOracle.bat" type= share start= auto displayname= "AutoStartOracle Services"
[SC] CreateService 成功
C:\Users\lenovo>services.msc
C:\Users\lenovo>sc help
sc query MyService查询刚建立的服务
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询