4 Replies - 557 Views - Last Post: 02 February 2012 - 10:51 AM Rate Topic: -----

Topic Sponsor:

#1 alpweb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-February 12

run app as admin programmatically

Posted 02 February 2012 - 09:15 AM

I have small tool developed in ms access 2010.

This tool i run using admin command prompt , so i drag and drop accd file to admin command prompt.

Through this tool, i am launching some tools which requires admin rights. and it was working ok in XP, but not in win7, so i have converted mdb file to 2010 and change some code, so now when it launch app and if it needs admin rights it prompts for user / password, so i supply admin user/password, it works ok.

is there anyway i can pass admin user/password in code , that way UAC will not keep prompting to enter user/password again and again, whenever it launch app.

Is This A Good Question/Topic? 0
  • +

Replies To: run app as admin programmatically

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 211
  • View blog
  • Posts: 1,249
  • Joined: 26-March 09

Re: run app as admin programmatically

Posted 02 February 2012 - 09:20 AM

Can't you just set the properties of the app to always run as administrator (Right click - Properties/Compatibility/Privilege Level)?
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1  Icon User is online

  • Suiter #2
  • member icon


Reputation: 3556
  • View blog
  • Posts: 14,985
  • Joined: 12-June 08

Re: run app as admin programmatically

Posted 02 February 2012 - 09:24 AM

I would agree with maj3 - the UAC's there for a reason - trying to circumvent it seems unnecessary with the 'always run as admin' option.
Was This Post Helpful? 0
  • +
  • -

#4 alpweb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-February 12

Re: run app as admin programmatically

Posted 02 February 2012 - 09:30 AM

View Postmaj3091, on 02 February 2012 - 09:20 AM, said:

Can't you just set the properties of the app to always run as administrator (Right click - Properties/Compatibility/Privilege Level)?



I did, and that's why it now prompts for user/password, whenever it launch the app.

for example, i want to launch MMC.exe, or access remote computer by \\pc\C$, it keeps prompting password each time. I thought if i can store user/password (encrypted) in database and when i want to launch mmc.exe for example i will password that admin user/password. That way it will work just like in XP.
Was This Post Helpful? 0
  • +
  • -

#5 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 211
  • View blog
  • Posts: 1,249
  • Joined: 26-March 09

Re: run app as admin programmatically

Posted 02 February 2012 - 10:51 AM

Have a read at this link, it should do what you need.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1