Doc Symbiosis Posted January 17, 2006 Posted January 17, 2006 (edited) Hi there, in a vb-Script I wanted to do a little automatic Filesystem detecting, I stumbled across the following:When I try to run the follwoing script with an existing, but nonformated drive d:, no message is shown. Works fine, when drive d: has NTFS or FAT. Can anyone explain why?strComputer = "."Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colDisks = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk Where DeviceID = 'D:'")For Each objDisk in colDisks If NOT (objDisk.Filesystem="NTFS") Then Wscript.Echo "This is No NTFS" End If If (objDisk.Filesystem="NTFS") Then Wscript.Echo "This is NTFS" End IfNextThanks in advance Edited January 17, 2006 by Doc Symbiosis
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now