title: VS2010 setup project - Launch application after install as administrator using PostBuildEvent
body: <p>I have a Winform application that was developed using VS2010 C# I created an installer(setup) project and everything worked great. The main application changes the network metric of a proprietary network adapter and has to be run as administrator to function properly. This was done by adding an app.manifest with <code>&lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false" /&gt;</code></p>
  
  <p>Then we decided that we want the option to launch the app directly after install. I did this by adding the following PostBuildEvent: <strong>cscript.exe "$(ProjectDir)EnableLaunchApplication.js" "$(BuiltOuputPath)"</strong> The .js file can be found on Aaron Stebner's blog at <a href="http://blogs.msdn.com/b/astebner/archive/2006/08/12/696833.aspx" rel="nofollow">http://blogs.msdn.com/b/astebner/archive/2006/08/12/696833.aspx</a> The only thing I changed was the name of the .exe that is called.</p>
  
  <p>Now my application is started after the install, no problem. Only issue is that it is not started with elevated privileges so it does not function properly! If I close the application after install and start it from the desktop shortcut or the programs menu it is started with elevated privileges and working as expected.</p>
  
  <p>The .js file is something that I do not really know how to debug so this is a bit of a blind spot to me. I think I must at some point add the ability there to start the app in admin mode but I have no clue how, any help please?</p>
  
  <p>Thank you.</p>