Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a batch script using Windows shell commands to perform several administrative actions. The script is running great on Windows 7 but when i try launching it from Python 2.6 nothing happens:

import os
a = os.popen("somebatchfile.bat")

I assume that this is because the bat file uses several commands that require an administrative privileges but i don't want to prompt to a password using runas.exe or embedding the password within the code.

Is there any way to make UAC prompt for user approval or something?

share|improve this question
Are you running Python with elevated privileges? – squillman Jul 1 '11 at 16:00
Yes, this also occurs when i'm running Python with elevated privileges while under command line as administrator... – at0m Jul 3 '11 at 14:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.