BUG: You receive an "ActiveX component can't create object" error message when you Use Windows Script Host to execute remote script
This article was previously published under Q311269
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.
Steps to reproduce the problem Click Start, point to Programs, point to Accessories, and then click Notepad. 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.ExecuteWhile oProcess.Status <> 2 WScript.Sleep 100WEndWScript.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 -1End Sub</script></job></package>
Save the document with the file name RemoteTest.wsf. On the File menu, click New to create a new file. 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 Nowfout.Close</script></job></package>
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.
Article ID: 311269 - Last Review: 05/20/2005 21:53:32 - Revision: 2.2
Microsoft Windows Scripting Host 2.5
Keywords: kbdswmanage2003swept kbbug kberrmsg kbnofix KB311269