BUG: You receive an "ActiveX component can't create object" error message when you Use Windows Script Host to execute remote script


When you try to execute a remote script by using Windows Script Host (WSH) 5.6 on a Windows XP-based computer, you may receive the following error message:

Error: ActiveX component can't create object
Code: 800A01AD
Source: Microsoft VBScript Runtime Error


This behavior can occur if the setup for WSH remote scripting was performed incorrectly on your Windows XP-based system.


To resolve this issue, register the WScript object by running the wscript -regserver command from a command prompt or from the Run command on the Start menu.


Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

More Information

Steps to reproduce the problem

  1. Click Start, point to Programs, point to Accessories, and then click Notepad.
  2. Copy the following code, and then paste it into Notepad:
    <script language="VBScript">
    set oController = CreateObject("WSHController")
    set oProcess = oController.CreateScript(<Path To Remote Script>, <Server>)
    WScript.ConnectObject oProcess, "remote_"
    While oProcess.Status <> 2
    WScript.Sleep 100
    WScript.Echo "Done"

    Sub remote_Error
    Dim theError
    Set theError = oProcess.Error
    WScript.Echo "Error - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description
    WScript.Quit -1
    End Sub

  3. Save the document with the file name RemoteTest.wsf.
  4. On the File menu, click New to create a new file.
  5. Copy the following code, and then paste it into the new Notepad document:
    <script language="VBScript">
    set fso = CreateObject("Scripting.FileSystemObject")
    set fout = fso.CreateTextFile("c:\RemoteTest.txt", true)
    fout.WriteLine Now
  6. Save the document with the file name RemoteFile.wsf. When you run the RemoteTest.wsf file, the computer connects to the remote server and runs RemoteFile.wsf. Note that to connect to the remote server, you must supply both the path to the file and the server information.