Jump to content

RunAs with no password


Recommended Posts

Windows 7 Home Premium 64-bit, AutoIt 3.3.6.1.

Say I have a standard user account and an administrator account with no password. Skipping all consideration of whether or not this is a good practice, if, from the standard user account, I attempt to execute a program configured to run as administrator, I get a UAC prompt wanting me to enter the password of the administrator account. Since the administrator account doesn't have a password, I can just click Yes or hit Enter and the program runs. As far as I can tell, it's impossible to make the RunAs function run the program in this situation. For consistency, shouldn't the RunAs function be able to successfully specify either a blank or null password?

Link to comment
Share on other sites

If you are calling several apps requiring admin, or calling an app multiple times requiring admin FROM your AutoIt script, you could just add "#RequireAdmin" to the top of your script, and all subsequent Run calls will inherit the admin permissions without future prompts.

This way there will only be one initial prompt, when you start the script. Then you are free to call as many admin only applications as you please from within the script without the user being prompted by UAC.

Link to comment
Share on other sites

It's a security feature. It's the same reason you can't use remote desktop on accounts that have no password.

You'll have to add one or not use Windows.

Are you saying there is a restriction within Windows that prevents Autoit from invoking something as administrator without a password?

Link to comment
Share on other sites

The idea is that accounts with admin access should not be accessible by everyone. That defeats the purpose.

Agreed, but if one accepts that premise, then it's odd that responding to a UAC prompt supposedly requesting an administrator password works even if the administrator has no password, but if that's an inconsistency built in to Windows, so be it.

Link to comment
Share on other sites

If you are calling several apps requiring admin, or calling an app multiple times requiring admin FROM your AutoIt script, you could just add "#RequireAdmin" to the top of your script, and all subsequent Run calls will inherit the admin permissions without future prompts.

This way there will only be one initial prompt, when you start the script. Then you are free to call as many admin only applications as you please from within the script without the user being prompted by UAC.

While that doesn't directly address the password issue, it's helpful information which I will put to good use (unless I decide to disable UAC!).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...