Here is another way,
using WMI. Retrieves installed drives and their filesystems.
uses "Console" ' -- To be able to work with console
USES "WMI" ' -- To be able to manage WMI for hardware queries
USES "OS" ' -- To be able to retrieve PC name
' -- Variables
dim driveLabels as string
dim driveName as string
dim d as long
driveLabels = GetInfoOnDrives("DeviceID", "") ' -- Return info separated by tabelators
printl driveLabels
' -- Go through all driveLabels and get their file system
for d = 1 to parsecount(driveLabels, $TAB)
' -- Retrieve just one drive label from tabelator delimited list
driveName = PARSE$(driveLabels, $TAB, d)
' -- Put out formatted text
printL "Drive " + driveName + " has " + GetInfoOnDrives("FileSystem", "DeviceID='" + driveName + "'") + " file system"
next
' -- Wait for any key before program ends
waitkey
' -- End program ( optional )
stop
' --
' -- Auxiliary function to use WMI interface, you can ignore it and simply use it :)
' --
function GetInfoOnDrives( Feature as string, Condition as string ) as string
local sBuffer as string = WMI_GetData(OS_GetComputerName, "", "", "", "Win32_LogicalDisk", Condition, Feature )
local sLine() as string
local nLines as long
local OutString as string
local i as long
' -- WMI function returns big string, following will create array which can be scaned line by line
nLines = parse(sBuffer, sLine , $CRLF)
' -- We go through all lines and retrieve needed values
for i = 1 to nLines
if instr(sLine(i), Feature) > 0 then OutString += PARSE$(sLine(i), "=", 2) + $TAB
next
OutString = rtrim$(OutString, $TAB) ' -- Remove last TAB
function = OutString
end function
Hope you will find it useful,
Petr
Bookmarks