{"id":4338,"date":"2014-03-30T09:54:48","date_gmt":"2014-03-30T09:54:48","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-createprocessasuser-collection-of-common-programming-errors\/"},"modified":"2014-03-30T09:54:48","modified_gmt":"2014-03-30T09:54:48","slug":"problem-about-createprocessasuser-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-createprocessasuser-collection-of-common-programming-errors\/","title":{"rendered":"problem about createprocessasuser-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3d575ee50a8388454791b5f8e2841ba2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJader Dias<br \/>\nc# .net process createprocessasuser<br \/>\nI tried var process = new Process {StartInfo = new ProcessStartInfo{FileName = filename,UserName = &#8220;System&#8221;,UseShellExecute = false,}, };process.Start();but it yieldsWin32Exception was unhandledLogin failed: unknown user name or wrong passwordI will have to use CreateProcessAsUser? How can I get the appropriate parameters to pass to that method?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a7cd283f886e60241d921289f3c83f23?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMartin<br \/>\nc# winapi processes privileges createprocessasuser<br \/>\nI&#8217;ve been attempting to create a new process under the context of a specific user using the CreateProcessAsUser function of the Windows API, but seem to be running into a rather nasty security issue&#8230;Before I explain any further, here&#8217;s the code I&#8217;m currently using to start the new process (a console process &#8211; PowerShell to be specific, though it shouldn&#8217;t matter).private void StartProcess(){bool retValue;\/\/ Create startup info for new console process.var startupInfo = new STARTUPINFO();startup<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jader Dias c# .net process createprocessasuser I tried var process = new Process {StartInfo = new ProcessStartInfo{FileName = filename,UserName = &#8220;System&#8221;,UseShellExecute = false,}, };process.Start();but it yieldsWin32Exception was unhandledLogin failed: unknown user name or wrong passwordI will have to use CreateProcessAsUser? How can I get the appropriate parameters to pass to that method? Martin c# winapi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4338","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4338"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4338\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}