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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WScript.Shell Error -2147024769

Status
Not open for further replies.

CP60

Programmer
Oct 16, 2008
145
DE
A customer of ours has been using two of our programs for some time now with out this problem. Hundreds of other customers using W2000 to W7 have never encountered this problem (same proceedure code for several years)

Then they installed them on two other machines XP-SP3.
5.7 is the current version of WSH.

The program errors out at the following line:

Dim oWScript As Object
Set oWScript = CreateObject("WScript.Shell") 'Error here

and this also produces the same error (Reference to WSH):

Dim oWScript As WshShell
Set oWScript = New WshShell 'Error here

The error is -2147024769: Proceedure could not be found.

Strange. On the "Set" I would have expected a different error.

I gave the customer a Vbs script to test:
Code:
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\MyCompany\Test", "Passed!", "REG_SZ"
WScript.Echo WshShell.RegRead("HKCU\Software\MyCompany\Test")
WshShell.RegDelete "HKCU\Software\MyCompany\Test"

and it works, according to the screen shot the customer sent!

I checked all references and objects in my code and this this one proceedeure using WSH is the only place my oWScript is declared.

I am wondering if it has something to do with a security setting for creating ActiveX, but why would the Vbs work?
The customer claims that these two machines were set up identical to the other machines where the programs work, concerning security restrictions.

I am stumped at this one, and have never seen something similar before.

Any help is appreciated.
 

Forgot to mention that the Two programms I am referring to are VB6-SP6 programms , which are using WSH...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top