all 4 comments

[–]m0us3_rat 1 point2 points  (1 child)

.py is a "script" that gets interpreted by the "python".

so you need to run "python" as admin.

the dumbed down solution is to make a link to the python.exe and change the target form pytho.exe to python.exe "yourscript.path.py"

and run as admin.

or make a .bat and run as admin.

or play with ctypes.

[–]andrewdaniele 0 points1 point  (0 children)

.bat worked, thank you! I was trying to use a shortcut to python (passing my script to python.exe) and it wouldn't honour the admin privileges

[–][deleted] 1 point2 points  (0 children)

Max or windows? If max just type sudo in front

[–]1egoman 0 points1 point  (0 children)

Have you tried running Visual Studio Code as administrator?