<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CreateProcessWithLogonW Error: Zugriff verweigert]]></title><description><![CDATA[<p>Folgendes Problem:</p>
<p>Ich muss ein Programm mit Administratoren-Rechte ausfuehren, ich benutzte die Funktion &quot;CreateProcessWithLogonW&quot;, habe schon in der FAQ danach gesucht und leider nichts passendes gefunden:</p>
<p>ich bekomme naemlich folgende Fehler-Melung</p>
<p>.. failed with error: 5: Zugriff verweigert</p>
<p>ich benutze VC7.1 und eine Win32-Anwendung<br />
OS: Win Xp home</p>
<p>habe auch folgendes definiert</p>
<pre><code class="language-cpp">#define _WIN32_WINNT 0x0500
</code></pre>
<p>edit: hier noch etwas code (ps: das code styling is momentan noch egal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> )</p>
<pre><code class="language-cpp">char UserName[] = &quot;test&quot;;
	char Domain[] = &quot;.&quot;;
	char Password[] = &quot;test&quot;;
	WCHAR *Commandline = L&quot;C:\\Programme\\doxygen\\bin\\doxywizard.exe&quot;;
	const char * AppName = NULL;
	HANDLE Token;
	BOOL Result;
	PSID pSid = NULL;
	STARTUPINFOW si;
	PROCESS_INFORMATION pi;

	ZeroMemory(&amp;si, sizeof(STARTUPINFO));
	si.cb = sizeof(STARTUPINFO);

	Result = CreateProcessWithLogonW(L&quot;test&quot;,L&quot;.&quot;,
		L&quot;test&quot;,
		LOGON_WITH_PROFILE,
		L&quot;C:\\Programme\\doxygen\\bin\\&quot;,L&quot;doxywizard.exe&quot;,
		CREATE_DEFAULT_ERROR_MODE,
		NULL,L&quot;&quot;,&amp;si,&amp;pi);

	ErrorExit(&quot;CreateProcessWithLogonW&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/103070/createprocesswithlogonw-error-zugriff-verweigert</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 21:14:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/103070.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Mar 2005 14:12:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateProcessWithLogonW Error: Zugriff verweigert on Fri, 04 Mar 2005 14:15:14 GMT]]></title><description><![CDATA[<p>Folgendes Problem:</p>
<p>Ich muss ein Programm mit Administratoren-Rechte ausfuehren, ich benutzte die Funktion &quot;CreateProcessWithLogonW&quot;, habe schon in der FAQ danach gesucht und leider nichts passendes gefunden:</p>
<p>ich bekomme naemlich folgende Fehler-Melung</p>
<p>.. failed with error: 5: Zugriff verweigert</p>
<p>ich benutze VC7.1 und eine Win32-Anwendung<br />
OS: Win Xp home</p>
<p>habe auch folgendes definiert</p>
<pre><code class="language-cpp">#define _WIN32_WINNT 0x0500
</code></pre>
<p>edit: hier noch etwas code (ps: das code styling is momentan noch egal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> )</p>
<pre><code class="language-cpp">char UserName[] = &quot;test&quot;;
	char Domain[] = &quot;.&quot;;
	char Password[] = &quot;test&quot;;
	WCHAR *Commandline = L&quot;C:\\Programme\\doxygen\\bin\\doxywizard.exe&quot;;
	const char * AppName = NULL;
	HANDLE Token;
	BOOL Result;
	PSID pSid = NULL;
	STARTUPINFOW si;
	PROCESS_INFORMATION pi;

	ZeroMemory(&amp;si, sizeof(STARTUPINFO));
	si.cb = sizeof(STARTUPINFO);

	Result = CreateProcessWithLogonW(L&quot;test&quot;,L&quot;.&quot;,
		L&quot;test&quot;,
		LOGON_WITH_PROFILE,
		L&quot;C:\\Programme\\doxygen\\bin\\&quot;,L&quot;doxywizard.exe&quot;,
		CREATE_DEFAULT_ERROR_MODE,
		NULL,L&quot;&quot;,&amp;si,&amp;pi);

	ErrorExit(&quot;CreateProcessWithLogonW&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/737508</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/737508</guid><dc:creator><![CDATA[leo aka qsch]]></dc:creator><pubDate>Fri, 04 Mar 2005 14:15:14 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcessWithLogonW Error: Zugriff verweigert on Fri, 04 Mar 2005 18:24:43 GMT]]></title><description><![CDATA[<p>Hilft Ihnen dieser Beitrag: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-98607.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-98607.html</a></p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/737688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/737688</guid><dc:creator><![CDATA[Guten Tag]]></dc:creator><pubDate>Fri, 04 Mar 2005 18:24:43 GMT</pubDate></item></channel></rss>