Sign in to follow this  
Followers 0
Migs

Run As (administrator)

2 posts in this topic

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

Share this post


Link to post
Share on other sites



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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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