Obtaining Administrator Authority
-
Hi, I'm writing an application where I need administrator authority to create the database. I do not want to run as an administrator the entire time, just to create the file. How do I switch into Administrator mode and switch back? I know the User will get a prompt when trying to do this as I have seen other applications requesting administrator authority. Thank you,
Glenn
-
Hi, I'm writing an application where I need administrator authority to create the database. I do not want to run as an administrator the entire time, just to create the file. How do I switch into Administrator mode and switch back? I know the User will get a prompt when trying to do this as I have seen other applications requesting administrator authority. Thank you,
Glenn
Unless something has changed that I don't know about, you cannot switch back and forth. It's the entire process runs with admin priv's or nothing.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hi, I'm writing an application where I need administrator authority to create the database. I do not want to run as an administrator the entire time, just to create the file. How do I switch into Administrator mode and switch back? I know the User will get a prompt when trying to do this as I have seen other applications requesting administrator authority. Thank you,
Glenn
As Dave said - AFAIK you can't. You can create separate process to do the DB stuff and start that with elevated privileges though. Google "start new process with elevated privileges" and you will find many results.
Dave
Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) -
Hi, I'm writing an application where I need administrator authority to create the database. I do not want to run as an administrator the entire time, just to create the file. How do I switch into Administrator mode and switch back? I know the User will get a prompt when trying to do this as I have seen other applications requesting administrator authority. Thank you,
Glenn
I prefer to include an empty copy of the database with the app.