SCRIPT and GetObject

As @vefatica discovered recently, it would appear that GetObject does not work well with the SCRIPT command.

This example;
Code:
Set oMath = Nothing
Set oMath = GetObject("script:e:\utils\math.wsc")
oMath.StartFSO()
oMath.Display("Test")
Set oMath = Nothing
...executed with;
Code:
SCRIPT test.vbs
causes TCC to disappear.

Joe
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  27.00.18 x64   Windows 10 [Version 10.0.18363.1256]
 
I went back to;
Code:
TCC 15.01.04 Windows XP [Version 5.1.2600]
     _x64: 0
   _admin: 1
_elevated: 0
...and my example with GetObject works.
1610551692577.png

From TCC v24 to TCC v27, it does not work.

Joe
 

rconn

Administrator
Staff member
May 14, 2008
12,552
167
Windows bug (in ntdll, which is replacing TCC's error handler which is why it exits when ntdll crashes). Since Microsoft no longer supports the APIs in question, there's no chance of getting it "fixed".

Old versions of TCC work because they're using an alternate set of APIs which are no longer supported by the Windows SDK.

SCRIPT is pretty much obsolete; Microsoft has abandoned the technology.
 
Microsoft (R) Windows Script Host Version is currently at version 5.812, and has not been abandoned.
Active scripting is regarded complete, and no longer under active development by Microsoft.

However, the technology is still being supported by Microsoft's Sustaining Engineering Team, which is responsible for bug fixes and security enhancements.

Furthermore, scripting engines will continue to be shipped with future releases of Microsoft Windows and IIS.

It's taken me a while, but I have made a plugin for TCC called ActiveScript, with one command; ascript.
Code:
E:\...\plugin>plugin /i activescript
Module:      E:\Documents\PureBasic\ActiveScript\plugin\ActiveScript.dll
Name:        ActiveScript
Author:      Joe Caverly
Email:       jlcaverlyca@yahoo.ca
Web:         https://www.twitter.com/JoeC4281
Description: ActiveScript - TCC Plugin written using Purebasic
Implements:  AScript
Version:     2022.12  Build 29

The TCC Script command does not play well with GetObject.

The ActiveScript plugin does play well with GetObject.
Code:
TestIt()

Function TestIt
Set fso = CreateObject ("Scripting.FileSystemObject")
Set stdout = fso.GetStandardStream (1)

Set iWMI = GetObject("WinMgmts:Root\Cimv2")
Set colItems = iWMI.ExecQuery("SELECT * FROM Win32_Process")

If Err.number <> 0 Then
  stdout.WriteLine "Error"
End if

Results = ""

For Each objItem in colItems
  Results = Results + objItem.Name + vbCrLf
Next
TestIt = Results
stdout.WriteLine TestIt
End Function

Thus, I can now use Windows Scripting Components via my plugin;
Code:
Set oMath = GetObject("script:e:\utils\math.wsc")

I would like to incorporate the tcommand() interface in my ActiveScript plugin, but after a search of the TCMD SDK, I cannot see any way to do this.

Is it possible for me to include the tcommand() interface in my plugin?

I have attached my ActiveScript plugin for those that are interested.

It is not finished, it is not polished, and is still a work in progress.

Note also that it only works with VBScript (.vbs) files.

Joe
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  29.00.17 x64   Windows 10 [Version 10.0.19044.2364]
 

Attachments

  • activescript.7z
    16.1 KB · Views: 14

Similar threads