Jump to content

RunAsSet function executed on logon


 Share

Recommended Posts

I am new to AutoIT scripting. I would appreciate it if someone could help.

Aim:

Trying to install an application on the first logon with lockdown or restricted account

I am using AutoIt script executed as part of the Active Setup on the first logon. C:\Program Files\folder\folder\folder\Inst.exe"

"RunAsSet" function shown below then executes the Install.exe located in C:\Progra~1\marimba\Delivery\CL00687\Install.exe" below. Install.exe is another script which installs one of the applications required in my office. For this test I am trying to execute "regedit.exe" on the first logon.

RunAsSet("username", @Computername, "password")

RunWait("C:\Progra~1\folder\folder\folder\Install.exe")

RunAsSet()

Problem:

Running the above script works when logging on with local lockdown users but not with domain user controlled by a group policy. I get the folowwing error message:

Line 0 (File C:\Program Files\folder\folder\folder\Inst.exe"):

Run Wait(regedit.exe)

Error: Unable to execute the external program.

The directory name is invalid

Are there any other switches that I am missing? Please help!!!!!!!!!

Link to comment
Share on other sites

  • Developers

Maybe a path issue? (Another path in domain policy than in local users?) Try specifying the path in the runwait command.

... and also specify the WorkDir parameter because it could be that the default workdir isn't available with the RunAs credentials.

:)

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

... and also specify the WorkDir parameter because it could be that the default workdir isn't available with the RunAs credentials.

:)

I already tried specifying the full path but no luck. How do I add the WorkDir parameter, Can you please assist as I am using the AutoIT for the first time.
Link to comment
Share on other sites

  • Developers

Just check the helpfile for these things... its pretty clear:

RunWait

--------------------------------------------------------------------------------

Runs an external program and pauses script execution until the program finishes.

RunWait ( "filename" [, "workingdir" [, flag]] )

So in your case it could be something like:

RunWait("Program with full path"",@TempDir)

Jos

Edited by Jos

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