Jump to content

Recommended Posts

Posted (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 If
Next

Thanks in advance

Edited by Doc Symbiosis

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...