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



The information in this article applies to:

  • Microsoft Windows Script Host 2.0, when used with:
    • the operating system: Microsoft Windows XP

This article was previously published under Q311269

SYMPTOMS

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

CAUSE

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

RESOLUTION

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.

STATUS

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:
    <package>
    <job>
    <script language="VBScript">
    set oController = CreateObject("WSHController")
    set oProcess = oController.CreateScript(<Path To Remote Script>, <Server>)
    WScript.ConnectObject oProcess, "remote_"
    oProcess.Execute
    While oProcess.Status <> 2
       WScript.Sleep 100
    WEnd
    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
    
    </script>
    </job>
    </package>
    					
  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:
    <package>
    <job>
    <script language="VBScript">
    set fso = CreateObject("Scripting.FileSystemObject")
    set fout = fso.CreateTextFile("c:\RemoteTest.txt", true)
    fout.WriteLine Now
    fout.Close
    </script>
    </job>
    </package>
    					
  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.

Modification Type:MajorLast Reviewed:5/20/2005
Keywords:kbDSWManage2003Swept kbbug kberrmsg kbnofix KB311269 kbAudDeveloper