Request UAC elevation from within a Python script?

前端 未结 11 866

I want my Python script to copy files on Vista. When I run it from a normal cmd.exe window, no errors are generated, yet the files are NOT copied. If I run

11条回答
  •  我在风中等你
    2020-11-22 05:33

    If your script always requires an Administrator's privileges then:

    runas /user:Administrator "python your_script.py"
    

提交回复
热议问题