2

I would like my program to act as if it was not started as an admin for some calls. This is because my IDE (VB6 in this case) needs to run with admin rights but if I start my C++ DLL functions from the IDE I want to test if everything works well for normal users, too.

Is there any programmatical way (in either VB6 or C++) to achieve that?

Felix Dombek
  • 13,664
  • 17
  • 79
  • 131
  • 1
    Solve the problem by arranging that you don't need to run your IDE as admin. – David Heffernan Jan 08 '15 at 12:09
  • Not possible for VB6 on Windows 7 (and even my C++ IDE needs to run as admin to be able to register the output DLL) – Felix Dombek Jan 08 '15 at 12:34
  • Well, I don't think you are going about this the right way at all, but you seem to be set on your course. Good luck! – David Heffernan Jan 08 '15 at 12:35
  • 1
    See the accepted answer here: http://stackoverflow.com/questions/1287099/runas-a-different-user-when-debugging-in-visual-studio – MuertoExcobito Jan 08 '15 at 13:58
  • The VB6 IDE runs the code in-process in interpreted (p-code) mode. Since there is no separate process to run with a standard user token what you want isn't very practical. Even using a convoluted approach that de-elevated on run and re-elevated on stop would require a new UAC prompt. Just test the compiled EXE as a standard user after you complete elevated debugging, how hard is that? You should already be doing that anyway. – Bob77 Jan 08 '15 at 23:19
  • @Bob77 exactly what I'm doing now. It would still be nice to know how that de-elevation could possibly be achieved. – Felix Dombek Jan 09 '15 at 16:28

0 Answers0