ActiveX component can't create object: 'WScript.Shell'
Posted on 2006-05-05
This is the file that the problem occurs in.. prefastnew.dsm:
'DESCRIPTION: Reads the compilation options from the active project and compiles the active file with Prefast using these options
If Application.Documents.Count > 0 then
PathString = ActiveDocument.FullName
Set objShell = CreateObject("WScript.Shell")
If Projects Is Nothing Or Projects.Count < 1 Then
' Ask the user for preprocessor symbols e.g. _ADMIN. _DATASERVER, etc.
' Then prefast the actiuve file
Args = "C:\Prefast\prefastnew.bat " & PathString
' Get the compile options from the current dsp
' Then prefast the active file
Args = "cmd /V:on /c ""C:\Prefast\prefastnewVs6.bat " & ActiveProject.FullName & " " & ActiveDocument.FullName & """"
This is the error:
Line 11: ActiveX component can't create object: 'WScript.Shell'
This is what I've tried:
My OS is Windows XP Version 5.1(build 2600.xpsp_sp2_gdr.050301-1519 : Service Pack 2)
I made all internet explorer security settings low to allow execution of all ActiveX components.
I checked that "C:\WINNT\System32\wshom.ocx" is present on the system
I tried running wscript -regserver
I tried adding the registry entry "Remote" with a value of 1 to "HKEY_LOCAL_ MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings" registry subkey
I ran regsvr32 /v C:\WINDOWS\system32\wshom.ocx and checked that this is registered correctly. It apppears fine in the registry.
I ran all windows updates and reinstalled Windows XP service pack 2.
Lots of help on the net suggest that the problem may be with the syntax of Set objShell = CreateObject("WScript.Shell"). This line is correct for it's current use and the problem seems to be only with the object "WScript.Shell"