Jump to content
Sign in to follow this  
mega128

Execute a .vbs from AutoIT

Recommended Posts

mega128

Hi all,

I am trying to run a vbscript as local administrator account?

I wrote this but I am sure that this is not the best way to do it. Is there anyway to run this while cmd is hidden. Also, I don't this this code even is running as local admin account when pointer goes to cmd. Please help.

Thanks all for reading!

RunAsSet("local_admin_account",@ComputerName,"password")

RunWait("cmd")

send("C:\temp\test.vbs")

RunAsSet()

:P

Share this post


Link to post
Share on other sites
seandisanti

Hi all,

I am trying to run a vbscript as local administrator account?

I wrote this but I am sure that this is not the best way to do it. Is there anyway to run this while cmd is hidden. Also, I don't this this code even is running as local admin account when pointer goes to cmd. Please help.

Thanks all for reading!

RunAsSet("local_admin_account",@ComputerName,"password")

RunWait("cmd")

send("C:\temp\test.vbs")

RunAsSet()

:P

well the thing is, it runs cmd as admin, but that is the only run() that is called as admin. The thing is, the vbs is actually being run by WScript.exe. so you may want to try....

RunAsSet("local_admin_account",@ComputerName,"password")
RunWait("WScript.exe c:\temp\test.vbs")

Share this post


Link to post
Share on other sites
mega128

cameronsdad,

Thank you so much it worked like charm.

Thanks again,

Mega128

:P

Share this post


Link to post
Share on other sites
seandisanti

cameronsdad,

Thank you so much it worked like charm.

Thanks again,

Mega128

:P

glad i could help

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.