Click here to Skip to main content
15,888,031 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to run this script to install shockwave 11.6.1.629, but I get the following error:
Windows Script Host
Script:	F:\Files\Shockwave Player 11616269\Shockwave Player.vbs
Line:	71
Char:	2
Error:	The system cannot find the file specified
Code:	800700002	
Source: (null


VB
'=========================================================================
'
' NAME: Shockwave Player 1161629
'
' AUTHOR: Michael Roberts Desktop\Packaging Engineer 
'
' DATE: 08/30/2011
'
' COMMENT: 	This script will install Shockwave Player 1161629.
' 			If the installation is successful or failed the script will
'			copy a log file to a network share.
'==========================================================================

Option Explicit

Const OverwritExisting = True
Const ForWriting = 2
Const For_Appending = 8

Public wshShell, objFSO, sMSIfile, strComputer, objNetwork, statusFlag

Set objNetwork = WScript.CreateObject("WScript.Network")
statusFlag =""

Dim strlog : strlog = "C:\Logs\" & objNetwork.UserName & "." & objNetwork.ComputerName & "." & "Shockwave.log" 'Set log file
Dim netPath1 : netPath1 = "\\??.???.???.???\zen\LOGS\Adobe_Shockwave_1116629\Successful\" 'Target network
Dim netPath2 : netPath2 = "\\??.???.???.???\zen\LOGS\Adobe_Shockwave_1116629\Failure\" 'Target network

Dim strCommand, retErrcode, objFolder, sFolder, sComnd

Set wshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists("C:\Logs") Then
	sFolder = 1
Else
	'Create Logs folder if it does not exist
	Set objFolder = objFSO.CreateFolder("C:\Logs")
	sFolder = 0
End If

Dim objTextFile : Set objTextFile = objFSO.CreateTextFile(strlog, True)
	objTextFile.Close
Dim objFile : Set objFile = objFSO.GetFile(strlog)
Dim TS : Set TS = objfile.OpenAsTextStream (FOR_APPENDING)

If sFolder = 1 Then
 	logaction("C:\Logs folder exists")
Else
 	logaction("C:\Logs folder DOES NOT exist .. creating Logs folder.")
End If

sMSIfile = "sw_lic_full_installer"
logaction("The " & sMSIfile & " MSI (sw_lic_full_installer) is beginning its installation.")
RunHiddenCommand "msiexec /i """ & Replace(WScript.ScriptFullName, "\" & WScript.ScriptName, "") & "\" & sMSIfile & ".msi""" & " /qb!- REBOOT=ReallySuppress ALLUSERS=1 /l*v " & """C:\Logs\" & sMSIfile & ".log"""

'Un-install old versions of Adobe Shockwave with un-install utility
sMSIfile = "sw_uninstaller.msi"
RunHiddenCommand Replace(WScript.ScriptFullName, "\" & WScript.ScriptName, "") & "\" & sMSIfile & "sw_unistaller.msi.exe.exe -uninstall"

set objFSO = Nothing 
set objTextFile = Nothing  
set objFile = Nothing 
set TS = Nothing
Set wshShell = Nothing


Sub RunHiddenCommand(strCommand)
'	On Error Resume Next

	retErrcode = wshShell.Run (strCommand, 0, True)
	
	If retErrcode = 0 Then
		logaction("The " & sMSIfile & " process completed sucessfully. The return error code is: " & retErrcode)
		statusFlag = "Successful"
	Else
		statusFlag = "Failure"
	End If
End Sub

Sub logaction(strtext)
	TS.WriteLine(now & vbtab & strtext)
End Sub 

Wscript.Quit
Posted
Updated 23-Sep-11 8:48am
v2

1 solution

Line 71 is the RunHiddenCommand subroutine. One of your execution paths is invalid.

Put an echo in RunHiddenCommand and run the script on the command line to see which one.
 
Share this answer
 
Comments
Elliot Roberts 24-Sep-11 7:21am    
Not sure how where the @echo would go in this section

Sub RunHiddenCommand(strCommand)
' On Error Resume Next

retErrcode = wshShell.Run (strCommand, 0, True)
Mehdi Gholam 24-Sep-11 7:24am    
Put it before the run command, so you can tell where it fails.
Elliot Roberts 24-Sep-11 16:16pm    
I understand that, but I am not sure of the Syntax:
Sub RunHiddenCommand(strCommand)echo
' On Error Resume Next

retErrcode = wshShell.Run (strCommand, 0, True)echo
Mehdi Gholam 25-Sep-11 0:34am    
Wscript.echo strcommand

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900