Agent Orange Posted December 6, 2006 Share Posted December 6, 2006 (edited) I'm trying to run an msi as the local admin on the PC. I'm getting an error from msi about an incorrect parameter. Here is the code. Any ideas? RunAsSet("administrator", @ComputerName, "password") Run("msiexec /i \\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi","") RunAsSet() Thanks Edited December 6, 2006 by Agent Orange Link to comment Share on other sites More sharing options...
James Posted December 6, 2006 Share Posted December 6, 2006 use ifadmin Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Developers Jos Posted December 6, 2006 Developers Share Posted December 6, 2006 I'm trying to run an msi as the local admin on the PC. I'm getting an error from msi about an incorrect parameter. Here is the code. Any ideas? RunAsSet("administrator", @ComputerName, "password") Run("msiexec /i \\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi","") RunAsSet() ThanksDoubt if this ever will work because I expect the Local admin doesn't have the rights to get the file from \\server .. ? use ifadminMaybe follow your own advice ? 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...
James Posted December 6, 2006 Share Posted December 6, 2006 I dont get you JdeB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Joon Posted December 6, 2006 Share Posted December 6, 2006 Maybe it's space in a path... Try this RunAsSet("administrator", @ComputerName, "password") Run('msiexec /i "\\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi"','') RunAsSet() Link to comment Share on other sites More sharing options...
AzKay Posted December 6, 2006 Share Posted December 6, 2006 Maybe it's space in a path... Try this RunAsSet("administrator", @ComputerName, "password") Run('msiexec /i "\\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi"','') RunAsSet()You love those quotes dont you? Lol. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Valik Posted December 6, 2006 Share Posted December 6, 2006 I have couple things to say here. Why are you trying to run the MSI as any user? As I understand it, when you launch an MSI, the Windows Installer service is started which then performs the installation as the Local System account. So what are you trying to achieve by running as Administrator?Second, assuming the Administrator account can actually see the network share (As JdeB already pointed out), your working directory is probably the problem. You are not explicitly setting the working directory when you call Run() which means it is automatically set to @WorkingDir. If Administrator does not have access rights to be in the working directory, then Run() will fail. If you are running the script from the Desktop or anywhere in the user's profile area, the Administrator account can not access those folders. When using RunAsSet(), always always always set the working directory in any subsequent Run()/RunWait() calls, even if you just set it to @WindowsDir or the system root. Link to comment Share on other sites More sharing options...
Aqeel Posted December 7, 2006 Share Posted December 7, 2006 I'm trying to run an msi as the local admin on the PC. I'm getting an error from msi about an incorrect parameter. Here is the code. Any ideas? RunAsSet("administrator", @ComputerName, "password") Run("msiexec /i \\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi","") RunAsSet() Thanks Sir , This will never work, u need to copy the source files to local machine to work with the administrator. Thanks Link to comment Share on other sites More sharing options...
Joon Posted December 7, 2006 Share Posted December 7, 2006 (edited) Sir , This will never work, u need to copy the source files to local machine to work with the administrator.ThanksYou can have wide open share(Everyone:Full Control). Edited December 7, 2006 by Joon Link to comment Share on other sites More sharing options...
Aqeel Posted December 7, 2006 Share Posted December 7, 2006 You love those quotes dont you? Lol.i have the same problem with runasset and runwait functions, how to change the workingdir .Aqeel Link to comment Share on other sites More sharing options...
Valik Posted December 7, 2006 Share Posted December 7, 2006 Read the documentation? Link to comment Share on other sites More sharing options...
ECHAIGNE Posted December 7, 2006 Share Posted December 7, 2006 I'm trying to run an msi as the local admin on the PC. I'm getting an error from msi about an incorrect parameter. Here is the code. Any ideas? RunAsSet("administrator", @ComputerName, "password") Run("msiexec /i \\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi","") RunAsSet() Thanks Filecopy("\\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi", @tempdir & "\Misys Laboratory v6.1.0120.msi", 0) If Not IsAdmin() Then RunAsSet("administrator", @ComputerName, "password") EndIf RunWait('msiexec /i "' & @tempdir & '\Misys Laboratory v6.1.0120.msi"', @TempDir) RunAsSet() Filedelete(@tempdir & "\Misys Laboratory v6.1.0120.msi") Link to comment Share on other sites More sharing options...
Developers Jos Posted December 7, 2006 Developers Share Posted December 7, 2006 Filecopy("\\server\VOL1\Snaps\WinXP\XP_Misys Laboratory\v6.1.0120\Misys Laboratory v6.1.0120.msi", @tempdir & "\Misys Laboratory v6.1.0120.msi", 0)If Not IsAdmin() Then RunAsSet("administrator", @ComputerName, "password")EndIfRunWait('msiexec /i "' & @tempdir & '\Misys Laboratory v6.1.0120.msi"', @TempDir)RunAsSet()Filedelete(@tempdir & "\Misys Laboratory v6.1.0120.msi")@tempdir could be different for the RunAs credentials so this might fail ... 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...
Aqeel Posted December 7, 2006 Share Posted December 7, 2006 @tempdir could be different for the RunAs credentials so this might fail ...$CheckAdminPwd = RunAsSet("Administrator", @Computername, "adfdfsdf")$SoftSuccessFlag = RunWait("c:\temp\bentley\pre\setup.exe /Q")i m getting this error pls help>Running:(3.2.0.1):C:\Program Files\AutoIt3\autoit3.exe "Z:\ZENAPPS\Bentley1\Pre\test5.au3" Z:\ZENAPPS\Bentley1\Pre\test5.au3 (2) : ==> Unable to execute the external program.: $SoftSuccessFlag = RunWait("c:\temp\bentley\pre\setup.exe /Q") The directory name is invalid.If i use jusr runwait it works great.but if i run along with runasset then i m getting this error msgPls Help Aqeelmaqeel@gartnerlee.com Link to comment Share on other sites More sharing options...
Developers Jos Posted December 7, 2006 Developers Share Posted December 7, 2006 You did not put the workingdir in your RunWait() as advised ... 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...
Aqeel Posted December 7, 2006 Share Posted December 7, 2006 You did not put the workingdir in your RunWait() as advised ... Thnks JdeB, i did try putting the workingdir stilll the same. Could you pls show me where to add the workingdir in runwait. pls.$CheckAdminPwd = RunAsSet("Administrator", @Computername, "adfdfsdf")$SoftSuccessFlag = RunWait("c:\temp\bentley\pre\setup.exe /Q")>Running:(3.2.0.1):C:\Program Files\AutoIt3\autoit3.exe "Z:\ZENAPPS\Bentley1\Pre\test5.au3" Z:\ZENAPPS\Bentley1\Pre\test5.au3 (2) : ==> Unable to execute the external program.: $SoftSuccessFlag = RunWait("c:\temp\bentley\pre\setup.exe /Q") The directory name is invalid. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 7, 2006 Developers Share Posted December 7, 2006 RunWait("c:\temp\bentley\pre\setup.exe /Q","c:\temp\bentley") 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...
Aqeel Posted December 7, 2006 Share Posted December 7, 2006 RunWait("c:\temp\bentley\pre\setup.exe /Q","c:\temp\bentley") Thanks Jdeb, It worked the way u had shown. Just to share with you it also worked after i changed the workingdir location using the following syntax FileChangeDir("C:\temp\bentley\pre\"). Once Again thanks a lot , Aqeel 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