使用CMD命令行禁用Windows任务计划、启用任务计划、执行任务计划

禁用任务计划
SCHTASKS /change /DISABLE /TN “你的任务计划中的名称”
例: SCHTASKS /change /DISABLE /TN GoogleUpdate

启用任务计划
SCHTASKS /change /ENABLE /TN “你的任务计划中的名称”
例:SCHTASKS /change /ENABLE /TN GoogleUpdate

执行任务计划
schtasks /run /I /TN “你的任务计划中的名称”
例:schtasks /run /I /TN GoogleUpdate

 

 

查询状态
def getinfo():
    a = 'SCHTASKS /query /tn 1_test'
    b = os.popen(a, 'r', -1)
    c = ''.join(b.readlines()).replace('1_test', '')
    e = c.find('Disabled')
    print(e)

  

posted @ 2023-12-04 14:16  CrossPython  阅读(109)  评论(0编辑  收藏  举报