The problem of creating simple "windows script components" in Windows 7

I am trying to get a Windows Script component running on a development platform and x64. Works great on x32 bit. But it doesn't seem to work, I have the same problem with both JScript and VBScript.

The simplest wsc component is possible here. All that he does is pop up "Hello" in the message box. If you save the snippet below to a file called test_lib.wsc, you can right-click it and register it. Now it is available as a COM component.

<?xml version="1.0"?>
<component>
<?component error="true" debug="true"?>
<registration
    description="Test Script Library"
    progid="TestScript.Lib"
    version="1.00"
    classid="{314042ea-1c42-4865-956f-08d56d1f00a8}"
>
</registration>
<public>
  <method name="Hello">
  </method>
</public>
<script language="VBScript">
<![CDATA[
Option Explicit
Function Hello()
    MsgBox("Hello.")
End Function
]]>
</script>
</component>

Then create the following vb-script sample and save it in a file called test.vbs

dim o
set o = createobject("TestScript.Lib")
o.hello()

test.vbs cscript wscript, . "C:\test.vbs(3, 1) Microsoft VBScript: ActiveX :" TestScript.Lib "

32- XP. - - , ?

Noel.

+3
2

wsc Wndows Explorer, 64- Windows 7.

32- , wsc regsvr32 %windir%\sysWOW64, 64- cscript.exe 64- 64 32.

, wsc, regsvr32 %windir%\sysWOW64?

regsvr32, 32- ( sysWOW64), 64- ( 32), regsvr32.

Confused? :)

, 64- Windows:

+3

, 32- WScript CScript.

64- , 32- .

32- WScript CScript "%SystemRoot%\SysWOW64\

RegEdit: -

HKEY_CLASSES_ROOT\VBSFile\Shell\Open32\Command

: -

"%SystemRoot%\SysWOW64\WScript.exe" "%1" %*

Open32 VBS.

CScript , CSript SysWOW64.

0

Source: https://habr.com/ru/post/1732346/


All Articles