Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

Error "ActiveX component cannot create object Wscript.shell" & "ActiveX component cannot create object Wscript.Network"

Created: 10 Aug 2009 • Updated: 21 May 2010 | 10 comments
This issue has been solved. See solution.

Scenario: Created a vbscript custom action, trying to execute a vbscript custom action from the MSI.
'm getting this error, If i execute the script script separately. Please advise. Thanks.

Anji 

Comments 10 CommentsJump to latest comment

philbenson's picture

or should we be forced to use our "Psychic Debugging Powers"? Wait, I'll have a go... you do know that there is no need to explicitly create some objects, as the are already implicitly created when the MSI engine starts the vbs CA calling....

Cheers
Phil

Tillu1981's picture

Amar,
I suspect windows script host in your case. Try to download latest windows script host and install. You can also try to register the following file wshom.ocx
Start --> Run --> Type "regsvr32.exe wshom.ocx" [without quotes] --> press enter

If this doesn't fix your issue then try to download windows script host latest version and install. That should solve the issue.
WSH 5.7 Download Link: http://www.microsoft.com/downloads/details.aspx?FamilyID=47809025-D896-482E-A0D6-524E7E844D81&displaylang=en

Cheers,
Tillu

Cheers,
Tillu

SOLUTION
VBScab's picture

Do none of those things without first ensuring that you are NOT using the 'WScript' directive in front of your 'CreateObject' call. That is, change this:

     Set objWSHShell            = WScript.CreateObject("WScript.Shell")

to this:

     Set objWSHShell            = CreateObject("WScript.Shell")               

The WI engine uses its own interpreter (let's call it), and not the Windows Script Host which is what you call if you use 'WScript'. Note that, confusingly, you can create WScript objects (as in the above example).

Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

Amarendra's picture

Hi Phil,
Following is the sample code that i was testing:

'======================================
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSHELL = CreateObject("WScript.Shell")
WSHELL.Run(PATH,1,True)
'======================================

Though i create a vbscript and execute it manually, i was getting activex error [can not create wscript.shell].

Thank you Tillu!
I tried registering wshom.ocx file and it worked. Also i diownloaded and installed latest WSH. Thank you for the solution.

Amar...

 

philbenson's picture

explicitly calling cscript.exe "booHaa", wscript.exe "boohaa" or just double clicking the vbs file? 8Just out of interest)
As Ian has already stated, the CScript object is implicitly created during the MSI CA calling of vbs, hence (normally) the error.

Cheers
Phil

Eshwar's picture
Phil,
Recently i faced the same isue when i was executing the vbscript manually [from VBSEDIT]
I was not getting the error when i executed the same script with another machine.

Kyle, suggested me the following solution:

Start/Run:  regsvr32.exe wshom.ocx
regsvr32.exe sccrun.dll
 latest WSH install

And you know what, it worked. Now i'm able to execute the script manually in my machine.

Cheers,

Eshwar

philbenson's picture

the script debugging engine from MS, and not the "normal" runtime engine. I suspect there was someting "faul" with the initial installation.
<Edit>
The script debugging engine must also be correctly installed and registered
</Edit>

Cheers
Phil

VBScab's picture

I should, perhaps, have qualified my statement by saying that the WScript caveat only applies to embedded VBScript and not to scripts called externally, i.e. those included with the installation or comprssed into the Binary table.

Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

mjtpzfrL's picture

Hello;
 in my case, i wanted to execute an application on a machine A,  which Setup i have lost...i previously installed the Setup on a machine B.
For this, i have:
- copied all the exe and dll concerning the application  from  machine B , to paste them exactly in the same directory on as the were 
- then, i have copied all the reg files about the application on machine B  to paste them in registry of machine A
When launch  executable files, i get these messages:
 " ActiveX component can' t create object "
and 
" error 429 ActiveX component can' t create object " How to solve this???

EdT's picture

Copying the reg files will most likely achieve nothing. Try running the reg files so that the content is entered into the registry.
Also try registering any DLL and OCX files that you copied over.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.