推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
Tspm1eca
V2EX  ›  Python

如何用 wmi 模塊改變 windows 服務的啟動類型?

  •  
  •   Tspm1eca · Jun 23, 2015 · 3767 views
    This topic created in 4114 days ago, the information mentioned may be changed or developed.
    例如把某服務由自動改為手動。

    我試過用Win32_Service的 Change() 改, 但沒有改變。
    7 replies  •  2015-06-24 18:34:10 +08:00
    geeklian
        1
    geeklian  
       Jun 23, 2015
    =.=
    直接改注册表?一定要通过wmi么?
    Tspm1eca
        2
    Tspm1eca  
    OP
       Jun 23, 2015
    @geeklian 我不會改注册表, 朋友說用wmi很方便就用來試試, 但發現wmi沒有權限修改啟動類型。
    bin456789
        3
    bin456789  
       Jun 23, 2015
    何不用sc
    ChiChou
        4
    ChiChou  
       Jun 23, 2015
    sc config theme start=demand // demand 就是手动

    详细:
    https://technet.microsoft.com/en-us/library/cc990290.aspx
    Tspm1eca
        5
    Tspm1eca  
    OP
       Jun 24, 2015
    @ChiChou 謝謝
    Tspm1eca
        6
    Tspm1eca  
    OP
       Jun 24, 2015
    @ChiChou 想問多一個問題, 用sc 如何能用代碼取得權限?
    geeklian
        7
    geeklian  
       Jun 24, 2015 via iPhone
    @Tspm1eca 不通过uac,或者关闭uac就别想了...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   799 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 21:20 · PVG 05:20 · LAX 14:20 · JFK 17:20
    ♥ Do have faith in what you're doing.