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.
This topic is 16 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
koolezt
Posts: 15
Last visit: Sat Jun 19, 2010 5:12 am

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
Last visit: Sat Jun 19, 2010 5:12 am

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
Last visit: Thu May 29, 2008 5:08 am

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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
Last visit: Sat Jun 19, 2010 5:12 am

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.
This topic is 16 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked