title: VB.Net 1.1 CreateProcessWithLogonW Windows 7 returns error code 740
body: <p>I have an old vb.net 1.1 installer, which works fine on winxp, that I need to adapt so that it runs on win7. The architecture of the installer is pretty simple. It consists of 2 apps where the first one will launch the second app (it's the one doing the actual installation) to be executed under a power user credentials calling CreateProcessWithLogonW. </p>
  
  <p>After struggling for a while I came up with the <a href="http://blogs.msdn.com/b/cjacks/archive/2010/02/01/why-can-t-i-elevate-my-application-to-run-as-administrator-while-using-createprocesswithlogonw.aspx?Redirected=true" rel="nofollow">UAC</a> being in the middle. As far as I know there's no workaround to this besides disabling UAC on evey single machine which is something we can't do. </p>
  
  <p>Then investigating I came up to a way of <a href="http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/" rel="nofollow">requiring elevtion</a>. So I applied this to the second app which when double clicked it launches UAC and does the job as expected. But when I try to execute it from the first app (the launcher), through CreateProcessWithLogonW, I still get error 740 ERROR_ELEVATION_REQUIRED and obviously UAC is never launched. </p>
  
  <p>Is there something else that I should be looking at? Should I be using another API to launch the process on windows 7?</p>
  
  <p>Thanks in advanced!</p>