Jump to content

Execute a .vbs from AutoIT


mega128
 Share

Recommended Posts

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

Link to comment
Share on other sites

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")
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...