Messi Posted December 13, 2010 Share Posted December 13, 2010 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. Link to comment Share on other sites More sharing options...
Juvigy Posted December 14, 2010 Share Posted December 14, 2010 First try : RunAs($adminuser, $admindomain, $adminpass, 1, $filename) Then give us more info as on what OS you are trying that and fail. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 14, 2010 Developers Share Posted December 14, 2010 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? 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 More sharing options...
Messi Posted December 14, 2010 Author Share Posted December 14, 2010 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now