Request UAC elevation from within a Python script?

前端 未结 11 850

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条回答
  •  猫巷女王i
    2020-11-22 05:35

    This may not completely answer your question but you could also try using the Elevate Command Powertoy in order to run the script with elevated UAC privileges.

    http://technet.microsoft.com/en-us/magazine/2008.06.elevation.aspx

    I think if you use it it would look like 'elevate python yourscript.py'

提交回复
热议问题