9

Possible Duplicate:
How to run NOT elevated in Vista (.NET)
How do you de-elevate privileges for a child process

My program running as an elevated process, and starting new processes with Process.Start().

For security reasons, I would like to run those new processes as non-elevated.

How to do that?

Community
  • 1
  • 1
DxCK
  • 4,202
  • 6
  • 47
  • 86
  • I also asked and this question myself and found a solution that worked for me. http://stackoverflow.com/questions/1173630/how-do-you-de-elevate-privileges-for-a-child-process/2785337#2785337 – Davy8 Oct 13 '10 at 20:48

1 Answers1

2

Take a look at: How to run NOT elevated in Vista (.NET)

The answer is presented at that URL. Also, you may want to read http://go.microsoft.com/fwlink/?LinkId=81232 for why this is not such a good idea...

Community
  • 1
  • 1
Michael Goldshteyn
  • 68,941
  • 23
  • 129
  • 179
  • I like this solution, it actually works. the only problem is that it working only on EXE files. What should I do if I want to start .txt file? (it should implicitly start notepad non-elevated) – DxCK Oct 13 '10 at 22:16
  • One thing you can do is to find the default .exe associated in the registry with the .txt extension and then start that .exe passing it the .txt file. I don't know of any other way to get the behavior you desire (with elevation suspended). You can check my answer in http://stackoverflow.com/questions/3924753/where-does-windows-store-its-open-with-settings/3924822#3924822 to see how to get the application associated with an extension. – Michael Goldshteyn Oct 13 '10 at 23:41