Jump to content
Sign in to follow this  

RunAs and saved credentials

Recommended Posts


Hi all,

I have a question concerning the 'RunAs' function (AutoIt v3.2.12.1) and the 'saved credentials' of Windows XP Prof.


Im writing a script which displays a password dialog when executed as 'normal' user, asking for the password for an administrator account. The script then executes itself using the 'RunAs' function with the username/password of the administrator account. When started with administrator privileges, the script tries to execute a program in the context of a 'normal' user, using 'runas.exe' with the 'savecred' parameter (I use the 'savecred' parameter because I dont want to enter the password for the 'normal' user).

Run(@SystemDir & '\runas.exe /savecred /u: & @Computername & \' & $user & ' "cmd /c start \"no title\" /B \"' & $cmd & '""')


It seems like the RunAs function of AutoIt works in a way, that prevents one to access the saved credentials of an account. Because of that the listed call of the 'Run' function ends up in a shell asking for the password of the non-admin user.


Lets say the administrator account is called 'admin' and the user account is called 'usr'. When using the 'Run As' functionality of Windows XP to execute 'rundll32.exe keymgr.dll, KRShowKeyMgr' (which displays a dialog listing all saved credentials of an account) as user 'admin', I can see the saved credentials for 'admin' including the password for 'usr'. When executing 'rundll32.exe keymgr.dll, KRShowKeyMgr' with the 'RunAs' function of AutoIt (again as user 'admin') the saved credential dialog is empty.

Is it possible to use the 'RunAs' function in way, that allows one to access the saved credentials of an account?

Thanks in advance for your help!

Share this post

Link to post
Share on other sites

It seems like no one ever wanted to access saved credentials from a process executed with the new RunAs function?! :P

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.