<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C# code to detect UAC elevation on Vista</title>
	<atom:link href="http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html</link>
	<description>Tech writing blog</description>
	<lastBuildDate>Sun, 12 Feb 2012 21:04:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Stryder</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-440006</link>
		<dc:creator>Stryder</dc:creator>
		<pubDate>Thu, 17 Feb 2011 03:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-440006</guid>
		<description>Just an interesting note: The VistaTools class you provide is almost verbatim the exact same that Intuit provides for their QB SDK examples/tools.</description>
		<content:encoded><![CDATA[<p>Just an interesting note: The VistaTools class you provide is almost verbatim the exact same that Intuit provides for their QB SDK examples/tools.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gene</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-218672</link>
		<dc:creator>Gene</dc:creator>
		<pubDate>Tue, 27 Jul 2010 14:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-218672</guid>
		<description>Rajkumar: Starting and stopping windows services can be done through a ServiceController (see &lt;a href=&quot;http://www.csharp-examples.net/restart-windows-service/&quot; rel=&quot;nofollow&quot;&gt;sample code&lt;/a&gt;).  If you don&#039;t have enough rights to access ServiceController, then you will want to run (or perhaps just restart!) your process elevated.  That part is described here.</description>
		<content:encoded><![CDATA[<p>Rajkumar: Starting and stopping windows services can be done through a ServiceController (see <a href="http://www.csharp-examples.net/restart-windows-service/" rel="nofollow">sample code</a>).  If you don&#8217;t have enough rights to access ServiceController, then you will want to run (or perhaps just restart!) your process elevated.  That part is described here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajkumar</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-170230</link>
		<dc:creator>Rajkumar</dc:creator>
		<pubDate>Mon, 08 Mar 2010 07:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-170230</guid>
		<description>hi can u guys tell me how to use this to stop or start a windows service :( .... PLS HELP ME :(</description>
		<content:encoded><![CDATA[<p>hi can u guys tell me how to use this to stop or start a windows service <img src='http://www.itwriting.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  &#8230;. PLS HELP ME <img src='http://www.itwriting.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: René Hézser</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-145381</link>
		<dc:creator>René Hézser</dc:creator>
		<pubDate>Fri, 09 Oct 2009 09:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-145381</guid>
		<description>Thank you for sharing the code. Good work.
btw: You could use Resharper to clean up the code ;-)

René</description>
		<content:encoded><![CDATA[<p>Thank you for sharing the code. Good work.<br />
btw: You could use Resharper to clean up the code <img src='http://www.itwriting.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>René</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tim</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-104611</link>
		<dc:creator>tim</dc:creator>
		<pubDate>Tue, 29 Jul 2008 19:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-104611</guid>
		<description>@Kalyana

See here for how to start a process elevated:

http://www.danielmoth.com/Blog/2006/12/launch-elevated-and-modal-too.html</description>
		<content:encoded><![CDATA[<p>@Kalyana</p>
<p>See here for how to start a process elevated:</p>
<p><a href="http://www.danielmoth.com/Blog/2006/12/launch-elevated-and-modal-too.html" rel="nofollow">http://www.danielmoth.com/Blog/2006/12/launch-elevated-and-modal-too.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kalyana</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-104610</link>
		<dc:creator>Kalyana</dc:creator>
		<pubDate>Tue, 29 Jul 2008 19:12:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-104610</guid>
		<description>Is there a way to elevate the process. I m always getting the second screenshot mentioned above that UAC is enabled but its not elevated.</description>
		<content:encoded><![CDATA[<p>Is there a way to elevate the process. I m always getting the second screenshot mentioned above that UAC is enabled but its not elevated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hinjo</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-36628</link>
		<dc:creator>hinjo</dc:creator>
		<pubDate>Fri, 28 Sep 2007 13:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-36628</guid>
		<description>Hey, I&#039;m really interested in elevating my app from c#. Would it be too much of a hassle to publish that code, the c# wrapper and the dll?

Thanks</description>
		<content:encoded><![CDATA[<p>Hey, I&#8217;m really interested in elevating my app from c#. Would it be too much of a hassle to publish that code, the c# wrapper and the dll?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-15165</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Thu, 10 May 2007 07:57:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-15165</guid>
		<description>Thomas,

The code you reference is passing TokenElevationType as the value of TOKEN_INFORMATION_CLASS, whereas my IsElevated function is passing TokenElevation, which is meant to give a boolean result AIUI. I&#039;ve also implemented GetElevationType which gets the Default/Full/Limited result. 

Tim</description>
		<content:encoded><![CDATA[<p>Thomas,</p>
<p>The code you reference is passing TokenElevationType as the value of TOKEN_INFORMATION_CLASS, whereas my IsElevated function is passing TokenElevation, which is meant to give a boolean result AIUI. I&#8217;ve also implemented GetElevationType which gets the Default/Full/Limited result. </p>
<p>Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Geller</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-14770</link>
		<dc:creator>Thomas Geller</dc:creator>
		<pubDate>Mon, 07 May 2007 10:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-14770</guid>
		<description>Hi,

are you shure your function IsElevated is working correctly? I implemented the same function in Delphi 5 and &quot;GetTokenInformation&quot; always returned 0 running the prog as a not elevated administrator. Your c# implementation is doing exactly the same. I found this: http://groups.google.de/group/microsoft.public.dotnet.framework.interop/browse_thread/thread/63dadce5548b5bfe/931c034b5c7ee48b?lnk=st&amp;q=+TokenElevationType+return+value&amp;rnum=1#931c034b5c7ee48b and changed my Delphi code. Now my code returns TokenElevationTypeLimited for the case mentioned above. Starting my app as an Administartor I&#039;m getting TokenElevationTypeFull. This seems to be correct. I think your function seems to work correctly because you are doing this:
return (te.TokenIsElevated != 0);

cheers
Thomas</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>are you shure your function IsElevated is working correctly? I implemented the same function in Delphi 5 and &#8220;GetTokenInformation&#8221; always returned 0 running the prog as a not elevated administrator. Your c# implementation is doing exactly the same. I found this: <a href="http://groups.google.de/group/microsoft.public.dotnet.framework.interop/browse_thread/thread/63dadce5548b5bfe/931c034b5c7ee48b?lnk=st&#038;q=+TokenElevationType+return+value&#038;rnum=1#931c034b5c7ee48b" rel="nofollow">http://groups.google.de/group/microsoft.public.dotnet.framework.interop/browse_thread/thread/63dadce5548b5bfe/931c034b5c7ee48b?lnk=st&#038;q=+TokenElevationType+return+value&#038;rnum=1#931c034b5c7ee48b</a> and changed my Delphi code. Now my code returns TokenElevationTypeLimited for the case mentioned above. Starting my app as an Administartor I&#8217;m getting TokenElevationTypeFull. This seems to be correct. I think your function seems to work correctly because you are doing this:<br />
return (te.TokenIsElevated != 0);</p>
<p>cheers<br />
Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.itwriting.com/blog/198-c-code-to-detect-uac-elevation-on-vista.html/comment-page-1#comment-12885</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 23 Apr 2007 18:24:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.itwriting.com/blog/?p=198#comment-12885</guid>
		<description>&lt;blockquote&gt;
Shouldn’t Vista remember the elevation for a particular app, something like “elevate always!”
&lt;/blockquote&gt;
You can set this for a shortcut - under Compatibiity - Privilege level.

Tim</description>
		<content:encoded><![CDATA[<blockquote><p>
Shouldn’t Vista remember the elevation for a particular app, something like “elevate always!”
</p></blockquote>
<p>You can set this for a shortcut &#8211; under Compatibiity &#8211; Privilege level.</p>
<p>Tim</p>
]]></content:encoded>
	</item>
</channel>
</rss>

