×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VBScript - CreateObject("WScript.Shell") Prerequisites

VBScript - CreateObject("WScript.Shell") Prerequisites

VBScript - CreateObject("WScript.Shell") Prerequisites

(OP)
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

RE: VBScript - CreateObject("WScript.Shell") Prerequisites

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

What error does it throw?

RE: VBScript - CreateObject("WScript.Shell") Prerequisites

As xwb asks - what error message do you get?

RE: VBScript - CreateObject("WScript.Shell") Prerequisites

(OP)
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

RE: VBScript - CreateObject("WScript.Shell") Prerequisites

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

regsvr32 wshom.ocx

RE: VBScript - CreateObject("WScript.Shell") Prerequisites

(OP)
I tried that and got the message:

CODE

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close