Page 1 of 1 1
Topic Options
#38502 - 2003-03-27 11:44 PM Help enumerating Local disks
Jim Walker Offline
Lurker

Registered: 2003-03-27
Posts: 4
Loc: California
I'm attempting to try the Sample script on page 18 of the KiXtart 2001 manual.

$Drives = GetObject("winmgmts:").ExecQuery("select Name,DriveType from Win32_LogicalDisk")

if @error <> 0
? @error + " / " @serror
else
$FoundT=0
for each $Drive in $Drives
? $Drive.name
if $Drive.name = "T:"
$FoundT = 1
endif
next
endif

? "Results of t " + $FoundT get $x

This works as expected using WinXP. When I try it using Win98 I get the following error.
6 The handle is invalid.

Top
#38503 - 2003-03-27 11:49 PM Re: Help enumerating Local disks
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
it require WMI to be installed

win95, win98 and NT4 sp4 or lessdo not have it. But it can be DL'ed from MS

Review the WMIQuery() UDF for more info
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#38504 - 2003-03-27 11:53 PM Re: Help enumerating Local disks
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
for win9x you need to install the core:
http://www.microsoft.com/downloads/details.aspx?FamilyId=98A4C5BA-337B-4E92-8C18-A63847760EA5&displaylang=en
_________________________
!

download KiXnet

Top
#38505 - 2003-03-28 03:08 PM Re: Help enumerating Local disks
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
For remote WMI, you also need to install DCOM and configure the client explicitly for remote access.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.063 seconds in which 0.035 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org