c# - How to call a Win32 API with elevated priviledges on Windows 7 -


we have discovered code calls win32 setdatetime function needs run in elevated mode in windows 7, i.e. when logged in administrator, 1 still has choose run set date code administrator call change date.

is there can in code call function under elevated privileges?

this not how security works. changing clock very intrusive operation, has large number of side effects. there no mechanism in windows, or other operating system matter, start process limited privileges , arbitrarily bypass these limitations , gain administrator rights. there wouldn't point whatsoever running programs limited privileges if possible.

if want you'll have run program elevated rights. on vista , win7 requires run service or scheduled task. require administrator installed. uac provides way gain admin rights regular programs, have include manifest in program user notified privilege elevation. google 'requireadministrator', take first hit.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -