Sign in to follow this  
Followers 0
tbox

installing msi off network share as admin.

9 posts in this topic

Good morning,

I am having a problem installing a msi file off the network.

All of my client machines run non-admin so i need the msi to run as administrator so that the standard users can install this program off the network but not programs that i do not allow.

this is my script.

Local $sUserName = "installs"

Local $sPassword = "password!"

Local $sDomain = "admin"

RunWait($sUserName, $sDomain, $sPassword, 0, ("msiexec \\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi") , @SystemDir)

any help would be good.

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Good morning,

I am having a problem installing a msi file off the network.

All of my client machines run non-admin so i need the msi to run as administrator so that the standard users can install this program off the network but not programs that i do not allow.

this is my script.

Local $sUserName = "installs"

Local $sPassword = "password!"

Local $sDomain = "admin"

RunWait($sUserName, $sDomain, $sPassword, 0, ("msiexec \\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi") , @SystemDir)

any help would be good.

i also tried it this way.

; Script Start - Add your code below here

Local $sUserName = "installs"

Local $sPassword = "password"

Local $sDomain = "admin"

RunAs($sUserName, $sPassword, $sDomain")

FileChangeDir("\\sol\installs\Student Image\Programs\java")

$this = 'C:\Windows\System32\msiexec.exe /i "\\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi"'

Run($this)

this works if i remove the runas part. but i need the run as admin to work.

Thanks

Edited by tbox

Share this post


Link to post
Share on other sites

The last script you posted couldn't work at all, it should throw an error and exit before doing anything because the "RunAs" command synthax is wrong.

RunAs or RunAsWait should do the trick - one thing to check: are the users able to access the network share? What error are you getting?


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The last script you posted couldn't work at all, it should throw an error and exit before doing anything because the "RunAs" command synthax is wrong.

RunAs or RunAsWait should do the trick - one thing to check: are the users able to access the network share? What error are you getting?

all users can get to the network share so that is ok.

So should i be using the first script or the 2nd script?

I changed the 2nd script below

Local $sUserName = "installs"

Local $sPassword = "password"

Local $sDomain = "admin"

RunAsWait ($sUserName, $sDomain, $sPassword, 0)

FileChangeDir("\\sol\installs\Student Image\Programs\")

$this = 'C:\Windows\System32\msiexec.exe /i "\\sol\installs\Student Image\Programs\Movie Maker 2.6 Vista.msi"'

Run($this)

error message for the 2nd script is

RunAsWait ($sUserName, $sDomain, $sPassword, 0)

^ ERROR

this is the first script

; Script Start - Add your code below here

Local $sUserName = "installs"

Local $sPassword = "password"

Local $sDomain = "admin"

RunAsWait($sUserName, $sDomain, $sPassword, 0, ("msiexec \\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi") , @SystemDir)

i get the msiexec pop up box saying that i have miss typed it or something

Edited by tbox

Share this post


Link to post
Share on other sites

Was I right to tell you that the second script wouldn't work? Guess I was :x

You need to use the first script.

If msiexec gives you the error then you have to check your command line.

A quick look at the command line: ("msiexec \\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi") reveals one whitespace. Common-sense would tell that when you are passing arguments to most programs, white space is usually separating parameters, confusing the program this way. Solution is to enclose whatever contains white spaces in quotes.

Keeping this in mind, the command line has to be changed to: ("msiexec '\\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi'")

This should work.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I changed the things your said so it looks like this now.

; Script Start - Add your code below here

Local $sUserName = "installs"

Local $sPassword = "password"

Local $sDomain = "admin"

RunAsWait($sUserName, $sDomain, $sPassword, 0, ("msiexec '\\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi'") , @SystemDir)

But still get the msiexec pop up box.

The folder called "Student Image" has a space in it.. i thought this may make problems, renamed it to 1 word but still same problem :x

Edited by tbox

Share this post


Link to post
Share on other sites

You're not doing your homework very well :x

You forgot to specify the "install" option for msiexec. Type msiexec /? in a cmd window to see all the options.

Change your line to: "msiexec /i '\\sol\installs\Student Image\Programs\java\jre1.6.0_22.msi'"


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

hehe tried that still doesn't work :x

What i did notice though if i copied that folder off the network and to my local c drive and run this in a dos window it works fine...

msiexec /i c:\java\jre1.6.0_22.msi

The account i am using for the network is a network admin account so it has permissions so it should be ok.

Share this post


Link to post
Share on other sites

Well, working with network locations was never easy and juggling with command line parameters is many times a "trial-and-error" thing.

Unfortunately, without seeing exactly what msiexec told you I cannot pinpoint where the error is.

If it works from the local drive, add something to your script:

- copy first the *.msi file to local drive on Temp folder

- run it from there

- after install finishes, delete the *.msi


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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