Sign in to follow this  
Followers 0
Messi

How to Install an application (.exe) with local admin credentials

4 posts in this topic

Question: Hi,

We have an agent that needs to get installed to a number of computers.

The computers are remote laptops and there is no way for them to come back to the building.

What we are trying to do is to create a new .exe or .msi or something similar that contains commandline that will pass local admin credentials to the .exe (agent) file. so that it gets installed under the provided credentials.

Something like this:

1.) Commandline -> Execute the following .exe with the following local admin credentials local administrator/password

2.) Application - Agent which is a single .exe file

Wrap step 1 and 2 whitin a new .exe or .msi or something else that can be install by the user when they get the file.

Are there any applications in the market that will allow you to create a package from an .exe and add this type of commandline in order to execute the .exe with a different set of credentials?

run as administrator password to run this package.exe ----use packaging soft--------> newpackage.msi or .exe

I have been given the following script this basically will check to see if the logged in user is an Administrator and install the software using their credentials if true or it will attempt to use the local administrator username and password.

#NoTrayIcon

#RequireAdmin

$USR_USERNAME = 'Administrator

$USR_PASSWORD = 'Password'

$PKG_FILENAME = @TempDir & '\Package.exe'

FileInstall('Package.exe', $PKG_FILENAME)

If IsAdmin() Then

RunWait($PKG_FILENAME & ' /silentswitches', '', @SW_HIDE)

Else

RunAsWait($USR_USERNAME, @ComputerName, $USR_PASSWORD, 0, $PKG_FILENAME & ' /silentswitches', '', @SW_HIDE)

EndIf

FileDelete($PKG_FILENAME)

The script is fine when it compiles but the problem is that it does not pass the local administrator credentials to install the .exe when the user is NOT and administrator.

Does someone knows what is wrong here? Any help will be appreciate it.

Share this post


Link to post
Share on other sites



First try :

RunAs($adminuser, $admindomain, $adminpass, 1, $filename)

Then give us more info as on what OS you are trying that and fail.

Share this post


Link to post
Share on other sites

Any good reason to start a new topic in stead of continuing the one you already had and still had suggestion in that you didn't reply to?


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

Sorry my bad here I created this because I thought the other one didn't go through.

I will test your suggestion and get back to you.

Thanks.

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