views:

451

answers:

5

How can I find out the type of file system being used in Windows? Preferably in code.

+1  A: 

Right click on the drive in Explorer, choose Properties. The filesystem should be displayed there.

Brock Woolf
+5  A: 
function string get_FileSystem( strPath )
  object objFSO, objDrive;
begin
  set objFSO = CreateObject ( "Scripting.FileSystemObject" );
  if ( IsObject (objFSO) ) then
    try
      set objDrive = objFSO.GetDrive( objFSO.GetDriveName( strPath ) );
      if ( IsObject( objDrive ) ) then
        //Available return types include FAT, NTFS, FAT, FAT32, and CDFS
        return objDrive.FileSystem;
      endif;
    catch
      MessageBox( "Unable to determine File System.", INFORMATION );
    endcatch;
  endif;
end;

that's from http://kb.acresso.com/selfservice/viewContent.do?externalID=Q107782

John Boker
+3  A: 
Console.WriteLine(new DriveInfo(Environment.SystemDirectory).DriveFormat);

C#

JTA
+1  A: 

Just use Win32 api : Win32 FAQ since 1992 !

(see news://comp.os.ms-windows.programmer.win32)

Don't believe this answer. There is no FAQ for that newsgroup.
Rob Kennedy
A: 

If you meant Win32 and not .NET, see the WinAPI GetVolumeInformation() function. You can find it documented at http://msdn.microsoft.com

Ken White