Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


objshell.run msiexec problems!

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60133
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> objshell.run msiexec problems!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 objshell.run msiexec problems! - 5/12/2008 10:56:39 PM   
  DarkStrike

 

Posts: 3
Score: 0
Joined: 5/12/2008
Status: offline
Hi,

I am trying to install an MSI file with a TRANSFORM file via vbs but am having no success!

Here is the code I have so far:-

'**********
Option Explicit
Dim strPath, objShell, objFSO, objcmd, strobjshell, objmsi, objtransform, ProgramPath, files, folder
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

objShell.Run "cmd /c c: & ""msiexec /i \\pc14984\packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.msi"" & ""TRANSFORMS=\\pc14984\packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.mst""  /qb- ", 0, True

'**********

If I manually run the msiexec line from the run command on a pc it works fine so I know that should be ok :-
msiexec /i "\\pc14984\packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.msi" TRANSFORMS="\\pc14984\packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.mst" /qn


I get no errors returned but the file doesnt run and there are no entries in the event log for any failure.

Can anyone offer me some advice as to what I have got wrong?  Is there a better way to run the msi and transform from within a VBScript?

Thanks

< Message edited by DarkStrike -- 5/12/2008 10:59:32 PM >
 
 
Post #: 1
 
 RE: objshell.run msiexec problems! - 5/12/2008 11:12:48 PM   
  ehvbs

 

Posts: 2114
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi DarkStrike,

did you WScript.Echo the command you send to .Run? If not, do something like:

Dim sCmd : sCmd = "cmd /c c: & ""msiexec /i \\pc14 ..."
WScript.Echo sCmd
objShell.Run sCmd, 0, True

and double check this part of (the result of) your command:

  ... Edition.msi"" & ""TRANSFORM ...

I think , it puts a bad "&" into the string.

Good luck!

ehvbs

(in reply to DarkStrike)
 
 
Post #: 2
 
 RE: objshell.run msiexec problems! - 5/13/2008 12:50:23 AM   
  DarkStrike

 

Posts: 3
Score: 0
Joined: 5/12/2008
Status: offline
Thanks, I modified the line but still it doesnt work.

The line I want to run is as follows which works from the Run command:-

msiexec /i "\\pc14984\packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.msi" TRANSFORMS="\\pc14984\packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.mst""

Can you show me the best way to get this to run via a VB script?  I thought that the objShell.Run "cmd /k c: msiexec ..... was the way to go but it isn't looking good, am I missing something obvious here?  I am new to scripts so am working blindly on this.

(in reply to ehvbs)
 
 
Post #: 3
 
 RE: objshell.run msiexec problems! - 5/13/2008 1:35:10 AM   
  ehvbs

 

Posts: 2114
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi DarkStrike,

(1) Have a look at

    http://www.visualbasicscript.com/fb.aspx?m=59828

(2) post the result of your WScript.Echo sCmd line

(3) if you need the "c: &" (change drive to c:, next command) part, test it
     from a command line too

(4) Did you think about/check possible security/permission issues?

Good luck!

ehvbs

(in reply to DarkStrike)
 
 
Post #: 4
 
 RE: objshell.run msiexec problems! - 5/13/2008 2:59:16 AM   
  DarkStrike

 

Posts: 3
Score: 0
Joined: 5/12/2008
Status: offline
Hi,

Thanks, I decided to type the line out one more time and this time it worked, I added a & before the CD that I didn't have before!  The line now reads :-

objShell.Run "cmd /k c: & CD c:.. &  msiexec /i ""\\pc14984\Packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.msi"" TRANSFORMS=""\\pc14984\Packages\Bentley XM\Bentley MX 2\Bentley MX V8 XM Edition.mst"""

All I need to do now is get the uninstall of the previous version of the software working now! :)

Thanks again for your help!

(in reply to ehvbs)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> objshell.run msiexec problems! Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts