Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript - CreateObject("WScript.Shell") Prerequisites

Status
Not open for further replies.

jmarkus

Technical User
Oct 15, 2002
124
CA
I have a vbscript which works on my Windows 7 computer, but trips up on my colleague's. It throws an error at the following line:

Code:
Set objShell = CreateObject("WScript.Shell")

We both have Microsoft .NET Framework installed, although mine is 4.6.2 and his is 4.6.1

Is there some other prerequisite that he needs to have to run the script?

Thanks,
Jeff
 
Are we talking about vbscript or vb.net? VBScript has nothing to do with .net framework.

What error does it throw?
 
The error I get is:

Code:
ActiveX component can't create object: 'GetObject'

As for the language, this is VBscript as far as I know, I was just guessing that .NET might have something to do with it, but obviously I'm mistaken.

Here is some more related code which comes before the Wscript line maybe to help identify that it is VBscript:
Code:
Set oFSO = CreateObject("Scripting.FileSystemObject")

If Not oFSO.FolderExists( "C:\TEMP\BOM") Then
Set objFolder = oFSO.CreateFolder("C:\TEMP\BOM")
End If

Thanks,
Jeff

 
Sounds like the Windows Scripting Host Object Model is not registered properly. Try reregistering. Pop up a cmd prompt and type

regsvr32 wshom.ocx
 
I tried that and got the message:

Code:
The module "wshom.ocx" was loaded but the call to 
DllRegisterServer failed with error code 0x80040201

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top