error 0x800C000D instantiating component

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
koolezt
Posts: 15
Joined: Sat Dec 15, 2007 1:00 pm

error 0x800C000D instantiating component

Post by koolezt »

Please bear with this scripting newbie, as I suspect I'm overlooking something childishly simple, but I can't get components to work.In Windows XP Professional SP2 with wsh 5.7, I've used the MS Windows Script Component Wizard to make a trivial file C:workdemo.wsc with 1 component having just 1 read-only property (default supplied). Then I make C:workdemo.vbs containing (at line 5):Set oTool = WScript.GetObject("script:C:workdemo.wsc")In a command window rooted at c:work, I runcscript demo.vbsand this is what I get:C:workdemo.vbs(5, 1) (null): 0x800C000Ddemo.vbs's line 4 is a WshShell.popup(), and that works. Line 6 is another .popup() and that does NOT run. demo.wsc registers and unregisters successfully. The result is the same whether or not it is registered, and javascript behaves the same way.I really have something(s) significant to script. This demo is only for diagnostic purposes.Any help would be much appreciated.

User avatar
koolezt
Posts: 15
Joined: Sat Dec 15, 2007 1:00 pm

error 0x800C000D instantiating component

Post by koolezt »

Please bear with this scripting newbie, as I suspect I'm overlooking something childishly simple, but I can't get components to work.In Windows XP Professional SP2 with wsh 5.7, I've used the MS Windows Script Component Wizard to make a trivial file C:workdemo.wsc with 1 component having just 1 read-only property (default supplied). Then I make C:workdemo.vbs containing (at line 5):Set oTool = WScript.GetObject("script:C:workdemo.wsc")In a command window rooted at c:work, I runcscript demo.vbsand this is what I get:C:workdemo.vbs(5, 1) (null): 0x800C000Ddemo.vbs's line 4 is a WshShell.popup(), and that works. Line 6 is another .popup() and that does NOT run. demo.wsc registers and unregisters successfully. The result is the same whether or not it is registered, and javascript behaves the same way.I really have something(s) significant to script. This demo is only for diagnostic purposes.Any help would be much appreciated.

User avatar
donj
Posts: 416
Joined: Thu Nov 16, 2006 9:02 pm

error 0x800C000D instantiating component

Post by donj »

The way I usually see a WSC used (and you might try this to see if it works for you) is to right-click the WSC in Explorer to register it. You'll need to then use the ProgID defined in the WSC to instantiate it, using CreateObject() rather than GetObject().

jvierra
Posts: 14616
Joined: Tue May 22, 2007 9:57 am
Answers: 3
Has voted: 1 time
Been upvoted: 3 times
Contact:

error 0x800C000D instantiating component

Post by jvierra »

Don os more correct than I was. Sorry I missed the obvious. The Get will only work for an object that has already been loaded into memory. I don't think it will ever work with a WSC but I haven't tested that. The "Create" method is probaly what is needed as Don has pointed out.

User avatar
koolezt
Posts: 15
Joined: Sat Dec 15, 2007 1:00 pm

error 0x800C000D instantiating component

Post by koolezt »

Sorry about the delay, but I had password and login problems on this site.Thanks for the ideas, but I was waaay off-course. Noticing the resemblance to VBS classes and JS methods, I plunged in without my RFMs, and was doing so many things wrong, it's pathetic, but all is sorted now.Thanks again all.

Locked