3

I'm using msscript.ocx in my application which is an activex scripting host for windows.
Although I want to be able to use the same for XP embedded(XPe) which's highly customizable.

1.I want to know whether on XPe, msscript.ocx can be optionally installed or not?
2.Where does it get installed from, IE?
3.Or is it a windows core component which gets installed during the XPe setup?(I know one can unregister it, but can it be an optional installation)

Answering any or all of these questions will be of great help to me.

Thanks in advance.

Sam.

Samrat Patil
  • 788
  • 5
  • 23

3 Answers3

9

Microsoft's documentation of the MSScript.ocx library is somewhat contradictory on this issue. The short answer is, starting with Windows 2000, the MSScript.ocx library became part of the Windows OS. Subsequent service packs for Windows 2000, XP, and 2003 included bug fixes (1,2,3) for this library. Since that time, the library has remained part of the 32bit portion of Windows and is still included with Windows 7/2008 R2. Even 64bit versions of Windows still include msscript.ocx with WOW64 in C:\Windows\SysWOW64.

For a little history of this library's distribution keep reading.

Msscript.ocx was originally included on the Visual Studio 6 CD as a "optional" library - optional meaning it had to be manually installed. While the library was part of Visual Studio, it was migrated to being part of the Windows OS starting with Windows 2000.

This is where the confusion comes into play. Since msscript.ocx is considered to be a component of both VS6 and Windows 2000, updates were distributed in service packs for both. Even after the last service pack for VS6 was released, additional bug fixes needed to be distributed for older OS's, so a separate download was created specifically targeting Windows 95, 98 and NT4.

This download is targeted for older OS's for the simple fact that it had become a part of the OS in "modern" versions of Windows. If you are using Windows 2000 or greater, the download is unnecessary and - in my experience - can cause compatibility problems.

jveazey
  • 5,398
  • 1
  • 29
  • 44
  • VBScript is not Visual Basic 6. While the syntax is similar they are not the same. I'm running Windows 7 (64bit) and msscript.ocx is still distributed as part of the 32bit (C:\Windows\SysWOW64) portion of the OS. While the Windows dllhelp web site no longer exists, msscript.ocx is distributed with Windows 2000 and up. I have fresh installs of Windows 2000 and up for development and test purposes and I assure you it is there. – jveazey Nov 07 '10 at 02:05
  • John: You are right that it's part of Windows, but the DLL Help link you have doesn't work anymore. Maybe you should fix that. – Gabe Nov 07 '10 at 04:15
  • My mistake, sorry. I will delete those mistaken comments. +1 to you. – MarkJ Nov 07 '10 at 08:55
  • MarkJ: Thanks. I've had this same argument before. The download you pointed out, several pieces of Microsoft documentation, along with ambiguity between VB6 vs VBScript has created a great deal of confusion. I hope my updated answer will resolve this more quickly next time. – jveazey Nov 07 '10 at 09:10
  • Nice updates to the answer. I sometimes suspect that Microsoft *prefer* some ambiguity over whether these older technologies are still supported. There's a very similar situation with the Jet engine. Perhaps I'm just cynical. – MarkJ Nov 08 '10 at 17:41
1

I think it is not shipped with Windows XP(not a 100% sure)...

But the best choice is to ship it with your installer(even if it was shipped, it can be removed). About the installing - you can put it where you want (in the program folder in Program Files is ok), the important thing is to register it.

The best choice for making installers - Wix

EDIT: reference

The Script control ships with Visual Basic 6.0; however, Visual Basic 6.0 setup does not install the Script Control for you. The control is located in the CD directory Common\Tools\VB\Script. To install the script control, try the following steps:

I think this answers your question....

Svetlozar Angelov
  • 21,214
  • 6
  • 62
  • 67
  • Thanks Svet, but I need exact dependancy. I don't have a copy of XPe to test it out. I will update the same once I get my hands on XPe. Sam. – Samrat Patil Sep 02 '09 at 05:06
0

For those having issues getting MSSCRIPT.OCX to work do the following: Go to References in Project settings: Microsoft Script Control 1.0 Microsoft Scripting Runtime Microsoft Scriptlet Library

Check all those on. you'llneed to change your development environment to produce a 32 bit version of your appliation, which for most apps won't matter.

For this goto Project, then select Properties, select Compile, Target CPU: x86

In your code, and i'm using visual studio 2019,

' by using the references above the ScriptControl
' should become available for inclusion into your source c
Dim ms As ScriptControl = New ScriptControl
ms.Language = "JavaScript"
ms.Reset()
Try
    ms.ExecuteStatement(RichTextBox1.Text)
    Catch ex As Exception
        MessageBox.Show(ex.Message)
    End Try