<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Elevate through ShellExecute</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx</link><description>We often get the question how to elevate a process through ShellExecute. From the docs it is not immediately clear. The trick is passing in "runas" in the lpVerb. Here is a snippet to run notepad elevated. #include "stdafx.h" #include "windows.h" #include</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>pigfoot&amp;#8217;s weblog &amp;raquo; Elevate through ShellExecute</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#771820</link><pubDate>Tue, 26 Sep 2006 10:20:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:771820</guid><dc:creator>pigfoot’s weblog » Elevate through ShellExecute</dc:creator><description>PingBack from &lt;a rel="nofollow" target="_new" href="http://weblog.pigfoot.org/pigfoot/2006/09/26/elevate-through-shellexecute/"&gt;http://weblog.pigfoot.org/pigfoot/2006/09/26/elevate-through-shellexecute/&lt;/a&gt;</description></item><item><title>re: Elevate through ShellExecute</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#1790228</link><pubDate>Sat, 03 Mar 2007 00:14:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1790228</guid><dc:creator>Aaron Ballman</dc:creator><description>&lt;p&gt;For anyone else reading this, you should note that passing in NULL for the window handle is not advised since this can (and usually will) cause a dialog to be displayed. &amp;nbsp;(This assumes your application has some UI which triggers this action). &amp;nbsp;If you pass in NULL, then the dialog will be associated with the desktop window and be centered on the screen. &amp;nbsp;Instead, if you assign a valid window handle to it, the dialog will be displayed over the window whose handle you specify. &amp;nbsp;That provides a good visual correlation between the dialog which is displayed and the window which causes the action. &amp;nbsp;Just a little usability tip. &amp;nbsp;:-)&lt;/p&gt;
&lt;p&gt;Otherwise, awesome blog topic!&lt;/p&gt;
</description></item><item><title>re: Elevate through ShellExecute</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#1929102</link><pubDate>Thu, 22 Mar 2007 09:28:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1929102</guid><dc:creator>shiannji</dc:creator><description>&lt;p&gt;Hi Maarten:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;I am having trouble with this function &amp;quot;ShellExecute&amp;quot; or &amp;quot;ShellExecuteEx&amp;quot;.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;I hope to run telnet in Viata elevated thought ShellExecute.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;I have had to install the telnet client program.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;I tried the same as above syntax, but the system is passed as follow error message:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Windows cannot find 'telnet.exe'. Make sure you typed the name correctly, and then try again.&amp;quot;&lt;/p&gt;
&lt;p&gt;snippet code:&lt;/p&gt;
&lt;p&gt;ShellExecute:&lt;/p&gt;
&lt;p&gt;wsprintf(str, &amp;quot;telnet://%s&amp;quot;, inet_ntoa(ip));&lt;/p&gt;
&lt;p&gt;HINSTANCE ret = ShellExecute(Handle, NULL, str, 0, 0, SW_SHOWNORMAL);&lt;/p&gt;
&lt;p&gt;ShellExecuteEx:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;SHELLEXECUTEINFO shExecInfo;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.fMask = NULL;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.hwnd = NULL;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.lpVerb = &amp;quot;runas&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.lpFile = &amp;quot;telnet.exe&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.lpParameters = inet_ntoa(ip);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.lpDirectory = &amp;quot;C:\\Windows\\System32&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.nShow = SW_SHOWNORMAL;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;shExecInfo.hInstApp = NULL;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;ShellExecuteEx(&amp;amp;shExecInfo);&lt;/p&gt;
&lt;p&gt;Would you tell me, how can i do. Thanks a lot and so sorry my English is so poor.&lt;/p&gt;
&lt;p&gt;Frank.&lt;/p&gt;
</description></item><item><title>re: Elevate through ShellExecute</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#1966505</link><pubDate>Tue, 27 Mar 2007 21:28:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1966505</guid><dc:creator>SecureW2</dc:creator><description>&lt;p&gt;How would you advise transfering information between process that calls ShellExecute and the newly (elevated) process?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;T.&lt;/p&gt;
</description></item><item><title>Moving into Del Boca Vista with the Costanza's (Completed)</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#4986219</link><pubDate>Wed, 19 Sep 2007 00:02:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4986219</guid><dc:creator>Re-inventing The Wheel</dc:creator><description>&lt;p&gt;The last step in the Vista-related improvements I outlined several months ago involves improving the&lt;/p&gt;
</description></item><item><title>如何将自身进程运行为admin模式</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#6686592</link><pubDate>Fri, 07 Dec 2007 03:05:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6686592</guid><dc:creator>Smallfrogs' Technical BLOG</dc:creator><description>&lt;p&gt;张康宗 &lt;a rel="nofollow" target="_new" href="http://www.KZTechs.COM"&gt;http://www.KZTechs.COM&lt;/a&gt; Level:300 在Windows Vista里面，进程是分权限级别的。Windows会根据manifest内容、Windows Installer&lt;/p&gt;
</description></item><item><title>[OT] Windows Vista e UAC | hilpers</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#9357184</link><pubDate>Wed, 21 Jan 2009 21:16:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9357184</guid><dc:creator>[OT] Windows Vista e UAC | hilpers</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.hilpers.it/1717701-ot-windows-vista-e-uac"&gt;http://www.hilpers.it/1717701-ot-windows-vista-e-uac&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Script Elevation PowerToys - Programmstart mit Administratorrechten - drwindows.de</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#9569018</link><pubDate>Sun, 26 Apr 2009 11:58:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9569018</guid><dc:creator> Script Elevation PowerToys - Programmstart mit Administratorrechten - drwindows.de</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.drwindows.de/vista-toolbox/11420-script-elevation-powertoys-programmstart-mit-administratorrechten.html#post93686"&gt;http://www.drwindows.de/vista-toolbox/11420-script-elevation-powertoys-programmstart-mit-administratorrechten.html#post93686&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Download  Script Elevation PowerToys - Adminrechte f?r Anwendungen - Supernature-Forum</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx#9583622</link><pubDate>Sat, 02 May 2009 14:59:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9583622</guid><dc:creator>Download  Script Elevation PowerToys - Adminrechte f?r Anwendungen - Supernature-Forum</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.supernature-forum.de/betriebssystem-erweiterungen/90846-script-elevation-powertoys-adminrechte-fuer-anwendungen.html#post855674"&gt;http://www.supernature-forum.de/betriebssystem-erweiterungen/90846-script-elevation-powertoys-adminrechte-fuer-anwendungen.html#post855674&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>