tbox 0 Posted January 9, 2011 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
tbox 0 Posted January 9, 2011 (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 hereLocal $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 January 9, 2011 by tbox Share this post Link to post Share on other sites
enaiman 16 Posted January 9, 2011 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 scriptwannabe "Unbeatable" Tic-Tac-ToePaper-Scissor-Rock ... try to beat it anyway :) Share this post Link to post Share on other sites
tbox 0 Posted January 9, 2011 (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 belowLocal $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 isRunAsWait ($sUserName, $sDomain, $sPassword, 0)^ ERRORthis is the first script; Script Start - Add your code below hereLocal $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 January 9, 2011 by tbox Share this post Link to post Share on other sites
enaiman 16 Posted January 10, 2011 Was I right to tell you that the second script wouldn't work? Guess I was 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 scriptwannabe "Unbeatable" Tic-Tac-ToePaper-Scissor-Rock ... try to beat it anyway :) Share this post Link to post Share on other sites
tbox 0 Posted January 10, 2011 (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 Edited January 10, 2011 by tbox Share this post Link to post Share on other sites
enaiman 16 Posted January 10, 2011 You're not doing your homework very well 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 scriptwannabe "Unbeatable" Tic-Tac-ToePaper-Scissor-Rock ... try to beat it anyway :) Share this post Link to post Share on other sites
tbox 0 Posted January 10, 2011 hehe tried that still doesn't work 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
enaiman 16 Posted January 10, 2011 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 scriptwannabe "Unbeatable" Tic-Tac-ToePaper-Scissor-Rock ... try to beat it anyway :) Share this post Link to post Share on other sites