how would I make a python script request administraitor permition

Douglas Wiltz 1 Reputation point
2022-11-09T19:28:48.187+00:00

if I had a system that needs to alter something that requires admin access, how, using python, would i request access to these files?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,927 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,036 Reputation points
    2022-11-16T15:07:06.63+00:00

    Hi. Thank you for your question and reaching out. My name is John and I’d be more than happy to help you with your query.

    For Python.exe, create a shortcut.
    Modify the shortcut target to read C:xxx...python.exe your script.py instead.
    In the shortcut's property panel, select "advance..." and then "run as administrator."

    For reference, please see https://stackoverflow.com/questions/19672352/how-to-run-script-with-elevated-privilege-on-windows

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.
    Best regards,
    John

    0 comments No comments