Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wshshell not running 1

Status
Not open for further replies.

GrimR

IS-IT--Management
Jun 17, 2007
1,149
0
0
ZA
what is wrong here

Code:
Set wshShell = CreateObject("WScript.Shell")
strKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration"
strValue = "Platform" 
strData = "x86"
On Error Resume Next
strData = wshShell.RegRead(strKey & "\" & strValue)
On Error Goto 0 
Select Case strData
    Case ""
        MsgBox "Reg value '" & strKey & "\" & strValue & "' Not Found."
        WshShell.Run Chr(34) & "\\dbngt05\software$\Mimecast\O365 CTR\setup.exe - CTR" & Chr(34)
		
    Case "x86"
        MsgBox "reg data = x86, Quitting."
        WshShell.Run Chr(34) & "\\dbngt05\software$\Mimecast\Mimecast for Outlook 7.3.2061.19940 (32 bit)\Mimecast for Outlook 7.3.2061.19940 (32 bit).msi" /qn & Chr(34), 0, False
		
    Case "x64"
        WshShell.Run "MsiExec.exe /qn /x{A5C7145D-8E1B-44CD-99A3-AC242628C115}"
        WshShell.Run Chr(34) & "\\dbngt05\software$\Mimecast\Mimecast for Outlook 7.3.2061.19940 (64 bit)\Mimecast for Outlook 7.3.2061.19940 (64 bit).msi" /qn & Chr(34), 0, True

    Case Else
        MsgBox "Unexpected data found in reg value '" & strKey & "\" & strValue & "'.  Data = " & strData
        WScript.Quit
End Select

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
You may need to help us out here, since 'wshshell not running" isn't really specific enough.
 
Do you get an error if you comment out line 5?
 
Removed on error resume next and get Error line 20 Chr(..)
then tried
WshShell.Run "\\dbngt05\software$\Mimecast\Mimecast for Outlook 7.3.2061.19940 (64 bit)\Mimecast for Outlook 7.3.2061.19940 (64 bit).msi" /qn, 0, True
and get line 20 type mismatch 'wshshell'
any ideas

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
[TT]WshShell.Run "\\dbngt05\software$\Mimecast\Mimecast for Outlook 7.3.2061.19940 (64 bit)\Mimecast for Outlook 7.3.2061.19940 (64 bit).msi" /qn, 0, True[/tt]


 
strongm, I dont see any difference, BTW I did copy and paste yours still same errors

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
No, I'm flagging that you cannot use the /qn - at least not the way you are. Was trying to give you a hint rather than the fix, which should be

[TT]WshShell.Run "\\dbngt05\software$\Mimecast\Mimecast for Outlook 7.3.2061.19940 (64 bit)\Mimecast for Outlook 7.3.2061.19940 (64 bit).msi /qn", 0, True[/tt]

 
strongm, your way does not work to run the file Mimecast for Outlook 7.3.2061.19940 (64 bit).msi" /qn is correct (see below)

DOS
Code:
U:\Mimecast\Mimecast for Outlook 7.3.2061.19940 (32 bit)>"Mimecast for Outlook 7.3.2061.19940 (32 bit).msi /qn"
The directory name is invalid.
Run the way in my code works
Code:
U:\Mimecast\Mimecast for Outlook 7.3.2061.19940 (32 bit)>"Mimecast for Outlook 7.3.2061.19940 (32 bit).msi" /qn
Works fine


Windows ® Installer. V 5.0.7601.23593

msiexec /Option <Required Parameter> [Optional Parameter]

Install Options
</package | /i> <Product.msi>
Installs or configures a product
/a <Product.msi>
Administrative install - Installs a product on the network
/j<u|m> <Product.msi> [/t <Transform List>] [/g <Language ID>]
Advertises a product - m to all users, u to current user
</uninstall | /x> <Product.msi | ProductCode>
Uninstalls the product
Display Options
/quiet
Quiet mode, no user interaction
/passive
Unattended mode - progress bar only
/q[n|b|r|f]
Sets user interface level
n - No UI
b - Basic UI
r - Reduced UI
f - Full UI (default)
/help
Help information
Restart Options
/norestart
Do not restart after the installation is complete
/promptrestart
Prompts the user for restart if necessary
/forcerestart
Always restart the computer after installation
Logging Options
/l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <LogFile>
i - Status messages
w - Nonfatal warnings
e - All error messages
a - Start up of actions
r - Action-specific records
u - User requests
c - Initial UI parameters
m - Out-of-memory or fatal exit information
o - Out-of-disk-space messages
p - Terminal properties
v - Verbose output
x - Extra debugging information
+ - Append to existing log file
! - Flush each line to the log
* - Log all information, except for v and x options
/log <LogFile>
Equivalent of /l* <LogFile>
Update Options
/update <Update1.msp>[;Update2.msp]
Applies update(s)
/uninstall <PatchCodeGuid>[;Update2.msp] /package <Product.msi | ProductCode>
Remove update(s) for a product
Repair Options
/f[p|e|c|m|s|o|d|a|u|v] <Product.msi | ProductCode>
Repairs a product
p - only if file is missing
o - if file is missing or an older version is installed (default)
e - if file is missing or an equal or older version is installed
d - if file is missing or a different version is installed
c - if file is missing or checksum does not match the calculated value
a - forces all files to be reinstalled
u - all required user-specific registry entries (default)
m - all required computer-specific registry entries (default)
s - all existing shortcuts (default)
v - runs from source and recaches local package
Setting Public Properties
[PROPERTY=PropertyValue]


MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
From the commandline yes, but you cannot pass the same string to the wshShell run command. You have to wrap it up properly. Which you are not (but then, neither am I really, as I forgot that Run hiccups when faced with a path name with spaces AND a parameter needing to be passed).

[tt]WshShell.Run Chr(34) & "\\dbngt05\software$\Mimecast\Mimecast for Outlook 7.3.2061.19940 (64 bit)\Mimecast for Outlook 7.3.2061.19940 (64 bit).msi" & Chr(34) &" /qn", 0, TRUE[/tt]

(and you'll need to do the same for the 32bit line as well)
 
Thanks, strongm learnt something new

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top