4

Possible Duplicate:
Request UAC elevation from within a Python script?

I'd like to execute a series of Java processes from a Python script, but I must run the Java with elevated UAC privleges (as Administrator) in order to get the results I'm expecting. My call right now is basically:

from subprocess import Popen
callme = 'java weka.doStuff' # Want this to run as Administrator
Popen(callme)

How do I force this process to run as administrator or with some sufficiently high of elevated UAC privileges?

Community
  • 1
  • 1
machine yearning
  • 9,889
  • 5
  • 38
  • 51
  • 1
    Looks like the accepted answer in this question: http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script might solve your problem. – BrainStorm Jul 31 '11 at 14:08

1 Answers1

3

I'm afraid that you cannot use Popen for that.

One option would be using win32api.ShellExecute and setting runas argument to Administrator.

Another option would be using JPython itself...

plaes
  • 31,788
  • 11
  • 91
  • 89