Jump to content

Run As (administrator)


Migs
 Share

Recommended Posts

Hi guys,

I need to run a VB script at start up to install some printers. I'm running WinXP. I would like to use Auto It to run this script as a diferent user.

(This user would have elevated privilages to install the printers) Once the VB script has run I need the privilages to be set back to normal.

I have the following code:

Dim $UserName, $DomainName, $Password

$UserName = "User.surname"

$DomainName = "Mydomain"

$Password = "Password"

run("cscript c:\JT1138.vbs")

Reset user's permissions

RunAsSet()

I know the script is being ran however I'm not so sure the the permissions are being reset!! Also I would like to hide the CMD window so that the windows doesn't pop up when the script is being ran, there is only one problem I don't know how to do it!?

Can anyone help me please?

Thanking you in advance

Miguel

Link to comment
Share on other sites

  • Developers

Hi guys,

I need to run a VB script at start up to install some printers. I'm running WinXP. I would like to use Auto It to run this script as a diferent user.

(This user would have elevated privilages to install the printers) Once the VB script has run I need the privilages to be set back to normal.

I have the following code:

Dim $UserName, $DomainName, $Password

$UserName = "User.surname"

$DomainName = "Mydomain"

$Password = "Password"

run("cscript c:\JT1138.vbs")

Reset user's permissions

RunAsSet()

I know the script is being ran however I'm not so sure the the permissions are being reset!! Also I would like to hide the CMD window so that the windows doesn't pop up when the script is being ran, there is only one problem I don't know how to do it!?

Can anyone help me please?

Thanking you in advance

Miguel

You are missing a RunAsSet() command before the Run() ( which should probably also be replaced with a RunWait()

To Hide the command window just check out the RunWait() parameters in the helpfile ..

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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