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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now