View Single Post
Old 12-04-2007   #4 (permalink)
Toad


 
 

Re: How to elevate integrity level of a process

Darshan Tilak wrote:
Quote:

> Hi,
>
> I have written an application (win32 exe) that calls
> GetActiveObject() to get an object of Microsoft Excel. I use a batch
> file to launch this exe. This worked fine on XP, but the call
> returns a failure when used on Windows Vista. I found some answers
> for the same that suggest to elevate the process integrity level.
>
> So I have the following questions:
> -- How to elevate a processs integrity level? (where can i find the
> relevent information?) -- Will I have to change my application code
> to achieve this? -- Can a not simply make changes to the batch file,
> that calls the exe, to elevate the process integrity level?
>
>
> (I hope this is the right forum to ask this question. It will be
> really helpful if anyone can point me in the right direction.)
>
> Thanks,
> Darshan
Hi there,

I just got Vista by virtue of a new machine and was playing around with
UAC. Unfortunately, the runas command provided does not elevate rights
as does the Run as Administrator on the contecxt menu.

Anyway, I have compiled up shellas.exe which just calls ShellExecute
API with the runas verb as one of the parameters - this isn't different
than in XP.

So, now I can type shellas somecommand in the Run dialog and not have
to find the exe and right click on it... The command will run with
elevated rights as the user you select in the dialog.

I have gone a step further. In XP, I run as a limited user, but once I
log in, I become an administrator, so that I can optionally run
processes that need admin rights as myself and not another user (e.g.
installs). Upon, logoff I am depricated to a limited user again for the
next time.

I have now dome something similar in Vista, but it works subtley
different and isn't really as necessary any more, but works to keep
myself a limited user until I logon.

Toad

--

My System SpecsSystem Spec