Sign in to follow this  
Followers 0
dzebazapelo

RunAsSet function executed on logon

6 posts in this topic

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

Share this post


Link to post
Share on other sites



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


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

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.

:)


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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

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

Share this post


Link to post
Share on other sites

Thank you Guys for all your help, that worked. This was my final code:

RunAsSet("Username", @Computername, "Password")

RunWait("Script.exe", "C:\Progra~1\folder\folder\folder", @WorkingDir)

RunAsSet()

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