How to run python code as administrator ?
Python manually need to run as administrator how can i achieve this plse help ?
4/28/2019 1:41:49 PM
Programmer Raja (தமிழன்)
7 Answers
New AnswerK.Boopathi Where do you want to run your program? and on which platform? I mean from command prompt or in IDE? On Windows from command prompt, use runas command syntax : runas / user:administrator e.g runas /user:administrator notepad or launch the command prompt as administrator itself. then any program launched from the shell will runas administrator. From IDE: run the IDE as administrator itself then run the code from IDE. On linux/unix from terminal run python code as "su" or "sudo"
rajesh kumar when run your code it show no module win32com.shell What i need to do
K.Boopathi In your question you have written "python manually needs to run as administrator" ! Anyways can you be more specific what you are trying to do? Are you , through your code trying to access some resource on your machine that requires admin level access and wants that happens automatically?
K.Boopathi Some solutions here https://stackoverflow.com/q/19672352/7986108
K.Boopathi Ok. I now assume rajesh kumar answer provides you a solution you were looking for.