禁止停止和删除服务的输出

时间:2018-12-06 19:42:01

标签: python

# -------------------------------------------
# Stops Services folder
# ---------------------------------------------
import subprocess

# stop the service
def stopservice():
    args = ['sc', 'stop', 'My Service here']
    result = subprocess.run(args)
# stops the service
    args[1] = 'stop'
    result = subprocess.run(args)

# -------------------------------------------
# Deletes Services folder
# ---------------------------------------------
def deleteservice():
    args = ['sc', 'delete', 'My Service here']
    result = subprocess.run(args)
# deletes the service
    args[1] = 'delete'
    result = subprocess.run(args)

# Declared function to run to excute
stopservice()
deleteservice()

我想禁止服务的输出文本停止和删除,这可能吗?我见过类似的东西,但不了解它如何适合我的脚本

0 个答案:

没有答案