WSH from Wise for Windows Installer
I want to use Windows Script Host (WSH) from a VBScript called by a Wise install.
It seems that "Call VBScript from ..." does not have access to WSH.
The below VBScript fragment runs fine outside of Wise, but if called from the Wise install it fails.
If I step through with a debugger I get a "Variable is undefined 'WScript' " error
on the WScript.CreateObject call. (about line 9)
I am using Wise for Windows Installer 5.21 on WinXP SP2.
I am a very light Wise for Windows user and use it to deploy inhouse applications.
I have a hack/workaround that will work.
If I add my vbs file to the INSTALLDIR I can use "Execute Program from Destination"
to call wscript.exe/cscript.exe.
Setting the "working directory" to INSTALLDIR and
"EXE and command line" to "wscript.exe wise_test.vbs" works for this test script,
but is not the most intutive way to do it.
Am I doing something wrong or does Wise "hide" the WSH?
Thanks
Scott
It seems that "Call VBScript from ..." does not have access to WSH.
The below VBScript fragment runs fine outside of Wise, but if called from the Wise install it fails.
If I step through with a debugger I get a "Variable is undefined 'WScript' " error
on the WScript.CreateObject call. (about line 9)
I am using Wise for Windows Installer 5.21 on WinXP SP2.
I am a very light Wise for Windows user and use it to deploy inhouse applications.
I have a hack/workaround that will work.
If I add my vbs file to the INSTALLDIR I can use "Execute Program from Destination"
to call wscript.exe/cscript.exe.
Setting the "working directory" to INSTALLDIR and
"EXE and command line" to "wscript.exe wise_test.vbs" works for this test script,
but is not the most intutive way to do it.
Am I doing something wrong or does Wise "hide" the WSH?
Thanks
Scott
Option Explicit
'On Error Resume Next
Dim objSysInfo
Dim NETcomp_name
Dim WshNetwork
Dim errnum
Set WshNetwork = WScript.CreateObject("WScript.Network")
MsgBox "Error num: " & Err.Number
NETcomp_name = WshNetwork.ComputerName & "," & WshNetwork.UserDomain
MsgBox "Error num: " & Err.Number
MsgBox "net name: " & NETcomp_name
MsgBox "CompName is: " & NETcomp_name
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
brenthunter2005
19 years ago
Posted by:
srouse
19 years ago
ORIGINAL: brenthunter2005
You cant use the Wscript object because it is already kinda defined.
Remove the "wscript." references from your script and all will be fine.
Thanks,
That was easy.
Is this any of the help files? I looked and could not find anything.
Note to Wise Solutions Inc: Please add this to help file.
Thanks again
Scott
Posted by:
brenthunter2005
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.