Sign in to follow this  
Followers 0
Bob Coleman

RunAs with no password

10 posts in this topic

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?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Not AutoIt specifically, but any program.

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

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

Sorry that no topic post, but author, you should return to 2002-2003 year, there was a greatest ever Microsoft bug - null session :P I will not describe what is it, think everything is clear :mellow:

Share this post


Link to post
Share on other sites

Considering that was the start of XP, I'm pretty sure they won't be making that same mistake again.

Share this post


Link to post
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.

Share this post


Link to post
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!).

Share this post


Link to post
Share on other sites

danwilli is right. Running your one application as administrator is a much cleaner way to do it than to run each separately.

Share this post


Link to post
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
Sign in to follow this  
Followers 0