I'm in a position right now where my program needs access to write to the Program Files directory. From what I can tell, it seems like applications can request this kind of perm开发者_运维问答ission while they're running (the screen will go dark, and a box will pop up with Continue and Cancel buttons), although I'm not sure what I have to do to cause this to pop up.
If anyone can help, that would be great.
This has been asked and answered several times.
The short answer is, you can only do it through COM or launching another process.
See this question: Request Windows Vista UAC elevation if path is protected?
精彩评论