locked
Exception "The requested application requires elevation" RRS feed

  • Question

  • Hi, I wrote a photo processing program, which, when run for the first time, launches another program called "product activation" using System.Diagnostics.Process, which needs admin right to write to registry. But the photo processing program itself doesn't need admin right.

    In the "product activation" program which writes to registry, I used manifest file to demand admin right.

    It's all working fine on a 32 bit Windows 7. When the product activation program is invoked, Windows pops up the security alert dialog. You grant the permission, and all worked fine.

    But when run on 64 bit Windows 7, instead of popping up the security alert dialog, it throws an exception saying "The requested application requires elevation."

    How to get pass it?


    • Edited by Silan Liu Sunday, December 11, 2011 11:23 PM
    Sunday, December 11, 2011 5:54 AM

Answers

  • Found out why:

    Need to say following two lines:

                startInfo.UseShellExecute = true;

                startInfo.Verb = "runas";

    • Marked as answer by Silan Liu Tuesday, December 13, 2011 10:33 AM
    Tuesday, December 13, 2011 10:32 AM

All replies

  • Found out why:

    Need to say following two lines:

                startInfo.UseShellExecute = true;

                startInfo.Verb = "runas";

    • Marked as answer by Silan Liu Tuesday, December 13, 2011 10:33 AM
    Tuesday, December 13, 2011 10:32 AM
  • Hats off to you. This saved my life!!!!

    Renee


    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me

    Thursday, September 12, 2013 6:13 AM