I am trying to learn VB scripting by following the Windows 2000 Scripting
guide. Following along in the book (printout) using a script that reports
back free space on the c drive.

Const CONVERSION_FACTOR = 1048576
Set objWMIService = GetObject("winmgmts:")
Set objlogicalDisk = objWMIservice.Get("win32_LogicalDisk.DeviceID='C:â??â??)
FreeMegBytes = objLogicalDisk.freespace / CONVERSION_FACTOR
Wscript.Echo Int(FreeMegBytes)

When I add the line to access a remote computer ("winmgmts://" & Computer)

Const CONVERSION_FACTOR = 1048576
Computer = "billy"
Set objWMIService = GetObject("winmgmts://" & Computer)
Set objLogicalDisk =
objWMIService.Get("win32_LogicalDisk.DeviceID='C:â??â??)
FreeMegBytes = objLogicalDisk.freespace / CONVERSION_FACTOR
Wscript.Echo Int(FreeMegBytes)


I get a VBScript runtime error

Script: c:\vbstestarea\t1.vbs
Line: 3
Char: 1
Error: ActiveX component cantâ??t create object: â??GetObjectâ??
Code: 800A01AD
Source: Microsoft VBScript runtime error

Any help would most helpful

Re: ActiveX component =?UTF-8?B?Y2FudOKAmXQgY3JlYXRlIG9iamVjdDog?= by Brian

Brian
Tue Apr 05 14:14:35 CDT 2005

DonP wrote:
> I am trying to learn VB scripting by following the Windows 2000 Scripting
> guide. Following along in the book (printout) using a script that reports
> back free space on the c drive.
>
> Const CONVERSION_FACTOR = 1048576
> Set objWMIService = GetObject("winmgmts:")
> Set objlogicalDisk = objWMIservice.Get("win32_LogicalDisk.DeviceID='C:â??â??)
> FreeMegBytes = objLogicalDisk.freespace / CONVERSION_FACTOR
> Wscript.Echo Int(FreeMegBytes)
>
> When I add the line to access a remote computer ("winmgmts://" & Computer)
>
> Const CONVERSION_FACTOR = 1048576
> Computer = "billy"
> Set objWMIService = GetObject("winmgmts://" & Computer)
> Set objLogicalDisk =
> objWMIService.Get("win32_LogicalDisk.DeviceID='C:â??â??)
> FreeMegBytes = objLogicalDisk.freespace / CONVERSION_FACTOR
> Wscript.Echo Int(FreeMegBytes)
>
>
> I get a VBScript runtime error
>
> Script: c:\vbstestarea\t1.vbs
> Line: 3
> Char: 1
> Error: ActiveX component cantâ??t create object: â??GetObjectâ??
> Code: 800A01AD
> Source: Microsoft VBScript runtime error
>
> Any help would most helpful

I've never used WMI, but I think that ought to be a "wscript.getObject", not
just "getObject".

Re: ActiveX component cantâ??t create object: â??GetObjectâ?? by Michael

Michael
Tue Apr 05 22:48:13 CDT 2005

DonP wrote:
> I am trying to learn VB scripting by following the Windows 2000
> Scripting guide. Following along in the book (printout) using a
> script that reports back free space on the c drive.
>
> Const CONVERSION_FACTOR = 1048576
> Set objWMIService = GetObject("winmgmts:")
> Set objlogicalDisk =
> objWMIservice.Get("win32_LogicalDisk.DeviceID='C:â??â??) FreeMegBytes
> = objLogicalDisk.freespace / CONVERSION_FACTOR
> Wscript.Echo Int(FreeMegBytes)
>
> When I add the line to access a remote computer ("winmgmts://" &
> Computer)
>
> Const CONVERSION_FACTOR = 1048576
> Computer = "billy"


Where is the remote machine named 'billy' with respect to machine were you
run this script? What OS is running on that remote machine?


> Set objWMIService = GetObject("winmgmts://" & Computer)
> Set objLogicalDisk =
> objWMIService.Get("win32_LogicalDisk.DeviceID='C:â??â??)
> FreeMegBytes = objLogicalDisk.freespace / CONVERSION_FACTOR
> Wscript.Echo Int(FreeMegBytes)
>
>
> I get a VBScript runtime error
>
> Script: c:\vbstestarea\t1.vbs
> Line: 3
> Char: 1
> Error: ActiveX component cantâ??t create object:
> â??GetObjectâ?? Code: 800A01AD
> Source: Microsoft VBScript runtime error
>
> Any help would most helpful

--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.




=?Utf-8?Q?Re:_ActiveX_component_cant=C3=A2=E2=82=AC=E2=84=A2t_c?= by DonP

DonP
Wed Apr 06 07:15:02 CDT 2005



"Michael Harris (MVP)" wrote:

> DonP wrote:
> > I am trying to learn VB scripting by following the Windows 2000
> > Scripting guide. Following along in the book (printout) using a
> > script that reports back free space on the c drive.
> >
> > Const CONVERSION_FACTOR = 1048576
> > Set objWMIService = GetObject("winmgmts:")
> > Set objlogicalDisk =
> > objWMIservice.Get("win32_LogicalDisk.DeviceID='C:��) FreeMegBytes
> > = objLogicalDisk.freespace / CONVERSION_FACTOR
> > Wscript.Echo Int(FreeMegBytes)
> >
> > When I add the line to access a remote computer ("winmgmts://" &
> > Computer)
> >
> > Const CONVERSION_FACTOR = 1048576
> > Computer = "billy"
>
>
> Where is the remote machine named 'billy' with respect to machine were you
> run this script? What OS is running on that remote machine?
>
>
> > Set objWMIService = GetObject("winmgmts://" & Computer)
> > Set objLogicalDisk =
> > objWMIService.Get("win32_LogicalDisk.DeviceID='C:��)
> > FreeMegBytes = objLogicalDisk.freespace / CONVERSION_FACTOR
> > Wscript.Echo Int(FreeMegBytes)
> >
> >
> > I get a VBScript runtime error
> >
> > Script: c:\vbstestarea\t1.vbs
> > Line: 3
> > Char: 1
> > Error: ActiveX component cant�t create object:
> > ââ?¬Ë?GetObjectââ?¬â?¢ Code: 800A01AD
> > Source: Microsoft VBScript runtime error
> >
> > Any help would most helpful
>
> --
> Michael Harris
> Microsoft MVP Scripting
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Please ask follow-up questions via the original newsgroup thread.
>
>
>
>
Thanks for the responses

The target computer is in the same subnet and is running Windows NT sp6
My computer is running Windows 2000 sp4

After reading Michaelâ??s question I tried running the script on a 2K server
and a XP professional workstation. Both worked. Not just for this script but
also for another from the Script Center that reports logged in use.

I did read that some things would not work for NT but I was not expecting a
runtime error.
Can something be done to access the NT workstations?
Is there documentation on what works on NT?

I did try the â??wscript.getObject" it produced an error, 0x800c000d on both
NT and XP.

Thanks again to both for helping.


Re: ActiveX component cantââ?¬â?¢t create object: ââ?¬Ë?GetObjectââ?¬â?¢ by Michael

Michael
Wed Apr 06 18:38:00 CDT 2005

> The target computer is in the same subnet and is running Windows NT
> sp6
> My computer is running Windows 2000 sp4


Have you installed WMI on the NT box?

Download details: Windows Management Instumentation (WMI) CORE 1.5 (Windows
NT 4.0)
http://www.microsoft.com/downloads/details.aspx?familyid=c174cfb1-ef67-471d-9277-4c2b1014a31e&languageid=f49e8428-7071-4979-8a67-3cffcb0c2524&displaylang=en


--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.




=?Utf-8?B?UmU6IEFjdGl2ZVggY29tcG9uZW50IGNhbnTDg8Kiw6LigJrCrMOi?= by DonP

DonP
Thu Apr 07 12:55:06 CDT 2005



"Michael Harris (MVP)" wrote:

> > The target computer is in the same subnet and is running Windows NT
> > sp6
> > My computer is running Windows 2000 sp4
>
>
> Have you installed WMI on the NT box?
>
> Download details: Windows Management Instumentation (WMI) CORE 1.5 (Windows
> NT 4.0)
> http://www.microsoft.com/downloads/details.aspx?familyid=c174cfb1-ef67-471d-9277-4c2b1014a31e&languageid=f49e8428-7071-4979-8a67-3cffcb0c2524&displaylang=en
>
>
> --
> Michael Harris
> Microsoft MVP Scripting
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Please ask follow-up questions via the original newsgroup thread.
>
>
>
>

Yes thatâ??s much better. Thanks for the help. As my grandfather would say; I
was trying to start in the middle of the ladder.