Python and cmd admin access problem

iam new in writing codes with python and i was wondering can you run a cmd command like
“manage-bde -lock d: -forcedismount” or “shutdown –s –t ####” that require admin access from cmd/etc
in python ?
If anyone can answer, thank you…
im using Visual Studio Code with Python in windows 10 btw

Hi JJ,

Python has no way to override the operating system’s permissions, that

would be a terrible security bug if it did. That would mean any virus,

malware or spyware would simply have to use Python and just like that

they would have access to the entire system.

If your Python script needs admin access, you have to run it as a user

with admin access. Under Linux and Unix systems, the easiest way to do

that is with sudo:


but I don’t know what the equivalent is for Windows 10. That’s a Windows

question. If you can find out how to run any script with admin

privileges in Windows, Python scripts should work the same way.