Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

How to elevate integrity level of a process

microsoft.public.windows.vista.security






Speedup My PC
Reply
  #1 (permalink)  
Old 11-28-2007
Darshan Tilak
 

Posts: n/a
How to elevate integrity level of a process
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


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-28-2007
Pete Delgado
 

Posts: n/a
Re: How to elevate integrity level of a process

"Darshan Tilak" <darshan_tilak@persistent.co.in> wrote in message
news:e8JiZkaMIHA.5300@TK2MSFTNGP04.phx.gbl...
> 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.)


http://msdn2.microsoft.com/en-us/library/bb625964.aspx

I'm not sure that integrity levels are your problem though unless you are
running the batch file as another user or you are running it as a scheduled
task.

http://blogs.msdn.com/michael_howard...ows-vista.aspx

The above book is pretty good at explaining the basics, but there are many
details left out...

-Pete





Reply With Quote
  #3 (permalink)  
Old 12-05-2007
Toad
 

Posts: n/a
Re: How to elevate integrity level of a process
Darshan Tilak wrote:

> 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

--

Reply With Quote
  #4 (permalink)  
Old 12-05-2007
Darshan
 

Posts: n/a
Re: How to elevate integrity level of a process
Thanks. That link did put some light on why the GetActiveObject method was
failing. But i need to find a method to make my application work without
modifying the code. This is important because the application was initially
developed targeting the earlier windows versions (2000/2003/XP). And it also
works fine on vista, but only with UAC turned off.

"""What i want is to make it run on vista, with UAC turned on."""

My application is an exe (myapp.exe) that uses a COM dll (from where i call
GetActiveObject()). The whole thing is packaged in an installer (setup.exe)
using Install Sheild 11.5 (this does not claim to have any support for
vista). The myapp.exe is run from a batch file, which executes right after
the installation procedure and at machine startup. (I do not want a pop-up
everytime myapp.exe runs. It is supposed to run in the background.)

Would embedding a manifest (as explained below) solve my problem?
Is there any other way to make my setup.exe (or its indivudial components)
compatible to vista, with UAC turned on?

I tried embedding a manifest in myapp.exe using the command "mt.exe
/manifest myapp.exe.manifest -outputresource:myapp.exe;1". But it is still
failing i.e. GetActiveObject() still returns a failure. And I also get a
"consent prompt" when I run myapp.exe. My login belongs to the
administrators group on my vista machine.

Following is the manifest file that I used to embed:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="myapp"
type="win32"/>
<description>application description</description>
<ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
<ms_asmv2:security>
<ms_asmv2:requestedPrivileges>
<ms_asmv2:requestedExecutionLevel level="requireAdministrator">
</ms_asmv2:requestedExecutionLevel>
</ms_asmv2:requestedPrivileges>
</ms_asmv2:security>
</ms_asmv2:trustInfo>
</assembly>

Any suggestions/pointers are welcome.

Thanks,
- Darshan

"Pete Delgado" <Peter.Delgado@noads.net> wrote in message
news:u%23KqJmgMIHA.5208@TK2MSFTNGP04.phx.gbl...
>
> "Darshan Tilak" <darshan_tilak@persistent.co.in> wrote in message
> news:e8JiZkaMIHA.5300@TK2MSFTNGP04.phx.gbl...
>> 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.)

>
> http://msdn2.microsoft.com/en-us/library/bb625964.aspx
>
> I'm not sure that integrity levels are your problem though unless you are
> running the batch file as another user or you are running it as a
> scheduled task.
>
> http://blogs.msdn.com/michael_howard...ows-vista.aspx
>
> The above book is pretty good at explaining the basics, but there are many
> details left out...
>
> -Pete
>
>
>
>
>



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Launching medium integrity process from activex in IE protected mode fleet_captain@hotmail.com microsoft.public.windows.vista.security 0 11-16-2007 09:01
Elevate without losing the working directory? Michael A. Covington microsoft.public.windows.vista.security 7 08-05-2007 22:32
Elevate Command PowerToy BlogFeed Windows Vista Blogs Forum 0 07-13-2007 22:17
UAC can not elevate SimonW microsoft.public.windows.vista.administration accounts passwords 7 05-27-2007 20:35
Bharosa Verifies Biz Process Integrity Paul Security News 0 03-15-2007 17:46




All times are GMT +1. The time now is 16:42.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120