[python-win32] Dispatching something that requires elevation

Simon McConnell simonmcconnell at gmail.com
Sun Jun 10 20:20:06 EDT 2018


Sorry, I'm not sure what you mean by spawn the COM access in a separate
process.  This is my first time dabbling with COM objects.

I use the software every day in the traditional fashion so I know I have
access.  It looks like it spawns another process "System Login State
Manager" which seems to be the determinant of whether DCOM access is
allowed/denied.  I've noticed two instances of this running sometimes and
sometimes none.  I think most of the issues were self-induced from spawning
the process from python, it failing and me killing too many or not enough
of the tasks in task manager.

Is there a neat way to kill all the tasks that you've started when your
script fails without hitting the application's Quit call?  I am currently
wrapping it in a

fx = win32com.client.Dispatch('CimplicityME.Application')
try:
    # do stuff
except:
    fx.Quit()



On Mon, 11 Jun 2018 at 02:00 <python-win32-request at python.org> wrote:Date:
Sat, 9 Jun 2018 18:48:28 -0700

> From: Tim Roberts <timr at probo.com>
> To: Python-Win32 List <python-win32 at python.org>
> Subject: Re: [python-win32] Dispatching something that requires
>         elevation
> Message-ID: <B9651B5A-438D-4CCC-8018-B13656CB825B at probo.com>
> Content-Type: text/plain;       charset=utf-8
>
> On Jun 8, 2018, at 10:11 PM, Simon McConnell <simonmcconnell at gmail.com>
> wrote:
> >
> > I am trying to dispatch a COM interface of a program that is set to "Run
> as Administrator" in the Compatibility Settings of its properties.  Running
> the script w/o elevation results in a 'requires elevation' error.  Running
> the script with elevation results in a 'server execution failed' error,
> which I understand to be "I can't find that thing".
>
> No, actually.  That's 0x80080005, which is a DCOM "access denied" error.
> Are you quite sure this account has the privileges needed to run this
> software?
>
>
> > Removing the "Run as Administrator" from the Compatibility settings and
> running the script w/o elevation works, but unfortunately, this program
> needs to be run as administrator.
>
> So, are you saying you don't need elevation to call this server, you only
> need it for other parts?  Can you spawn the COM access into a separate
> process?
> ?
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20180611/c7bcbb7f/attachment-0001.html>


More information about the python-win32 mailing list