Sign in to follow this  
Followers 0
Guest emergent

RunAs Script?

2 posts in this topic

#1 ·  Posted (edited)

I am quite new at this scripting thing. I was wondering if someone could tell me how to write a script that will allow me run a saved mmc named "Admin.msc" under WinXP SP2 using a different username and password on an AD domain.

Example:

I want to run "c:\Admin.msc"

as "domain\administrator"

using password "xxxxxxxxx"

I cannot figure out how I need to write this as I know nothing about windows scripting other than basic batch files. I also want to compile it so that the password is not in clear text. That is why i want to us AutoIt.

Edited by emergent

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Your command is RunAsSet and you will use it like this:

RunAsSet ( "user", "domain", "password")
RunWait(@SystemDir & "\mmc.exe C:\admin.msc")
RunAsSet();<-- To restore initial account

AutoIt has a wonderful help file.Bother to read it please before posting cos that wasnt something difficult as you can see.

Be sure to download the SCiTe editor.And you can easily compile it from there after you have tested your script on the fly as many times as you want.

C ya

Edited by hgeras

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