Page 1 of 1 1
Topic Options
#125848 - 2004-08-30 02:25 PM Log if File-System is FAT32 or NTFS
Anonymous
Unregistered


Hi,

anyone having an idea, how i can find out,
if the C:-drive is FAT32 or NTFS-formatted
and log the result into a simple .TXT-File ?!

Regards,

Luziekix

Top
#125849 - 2004-08-30 02:51 PM Re: Log if File-System is FAT32 or NTFS
Anonymous
Unregistered


On what sort of machines? W95? W98? W2K? WXP? Mixed?
Top
#125850 - 2004-08-30 03:11 PM Re: Log if File-System is FAT32 or NTFS
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Quote:

On what sort of machines? W95? W98? W2K? WXP? Mixed?



If they're running NTFS on 9x machines, I doubt that it is supported.

I think that WMI is your friend. Here is a script from KiXomatic that could be adapted for your specific needs...

Code:

Break On
$strComputer = "."
$objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_LogicalDisk",,48)
For each $objItem in $colItems
"Access: " + $objItem.Access ?
"Availability: " + $objItem.Availability ?
"BlockSize: " + $objItem.BlockSize ?
"Caption: " + $objItem.Caption ?
"Compressed: " + $objItem.Compressed ?
"ConfigManagerErrorCode: " + $objItem.ConfigManagerErrorCode ?
"ConfigManagerUserConfig: " + $objItem.ConfigManagerUserConfig ?
"CreationClassName: " + $objItem.CreationClassName ?
"Description: " + $objItem.Description ?
"DeviceID: " + $objItem.DeviceID ?
"DriveType: " + $objItem.DriveType ?
"ErrorCleared: " + $objItem.ErrorCleared ?
"ErrorDescription: " + $objItem.ErrorDescription ?
"ErrorMethodology: " + $objItem.ErrorMethodology ?
"FileSystem: " + $objItem.FileSystem ?
"FreeSpace: " + $objItem.FreeSpace ?
"InstallDate: " + $objItem.InstallDate ?
"LastErrorCode: " + $objItem.LastErrorCode ?
"MaximumComponentLength: " + $objItem.MaximumComponentLength ?
"MediaType: " + $objItem.MediaType ?
"Name: " + $objItem.Name ?
"NumberOfBlocks: " + $objItem.NumberOfBlocks ?
"PNPDeviceID: " + $objItem.PNPDeviceID ?
"PowerManagementCapabilities: " + $objItem.PowerManagementCapabilities ?
"PowerManagementSupported: " + $objItem.PowerManagementSupported ?
"ProviderName: " + $objItem.ProviderName ?
"Purpose: " + $objItem.Purpose ?
"Size: " + $objItem.Size ?
"Status: " + $objItem.Status ?
"StatusInfo: " + $objItem.StatusInfo ?
"SupportsFileBasedCompression: " + $objItem.SupportsFileBasedCompression ?
"SystemCreationClassName: " + $objItem.SystemCreationClassName ?
"SystemName: " + $objItem.SystemName ?
"VolumeName: " + $objItem.VolumeName ?
"VolumeSerialNumber: " + $objItem.VolumeSerialNumber ?
?
Next


Top
#125851 - 2004-08-30 03:19 PM Re: Log if File-System is FAT32 or NTFS
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
> On what sort of machines? W95? W98? W2K? WXP? Mixed?

Oh sorry ... Iīll tell you ...:

No Win9x-Machines, only WinNT-Line (NT4, 2000, XP)

Luziekix

Top
#125852 - 2004-08-30 03:21 PM Re: Log if File-System is FAT32 or NTFS
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
Hi,

will WMI run on NT4 without install/adding something ?

Regards,

Luziekix

Top
#125853 - 2004-08-30 03:24 PM Re: Log if File-System is FAT32 or NTFS
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
You would have to install WMI on NT4-based machines, yes.
Top
#125854 - 2004-08-30 03:28 PM Re: Log if File-System is FAT32 or NTFS
Anonymous
Unregistered


NT4 WMI installer
Top
#125855 - 2004-08-30 03:30 PM Re: Log if File-System is FAT32 or NTFS
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
OK, thanks,

anyone having a way without the need to
install WMI on our NT4-machines ?!

Regards,

Luziekix


Edited by Luziekix (2004-08-30 03:30 PM)

Top
#125856 - 2004-08-30 03:35 PM Re: Log if File-System is FAT32 or NTFS
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
THis would be easy to convert:
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colDrives = objFSO.Drives
For Each objDrive in colDrives
Wscript.Echo "Available space: " & objDrive.AvailableSpace
Wscript.Echo "Drive letter: " & objDrive.DriveLetter
Wscript.Echo "Drive type: " & objDrive.DriveType
Wscript.Echo "File system: " & objDrive.FileSystem
Wscript.Echo "Free space: " & objDrive.FreeSpace
Wscript.Echo "Is ready: " & objDrive.IsReady
Wscript.Echo "Path: " & objDrive.Path
Wscript.Echo "Root folder: " & objDrive.RootFolder
Wscript.Echo "Serial number: " & objDrive.SerialNumber
Wscript.Echo "Share name: " & objDrive.ShareName
Wscript.Echo "Total size: " & objDrive.TotalSize
Wscript.Echo "Volume name: " & objDrive.VolumeName
Next

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#125857 - 2004-08-30 03:40 PM Re: Log if File-System is FAT32 or NTFS
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
Ey, sorry, ... I think the last uses WSH,
and this sadly isnīt available on our NT4-machines too ...

Luziekix

Top
#125858 - 2004-08-30 03:40 PM Re: Log if File-System is FAT32 or NTFS
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
but ... is FSO intrinsic in NT ??
_________________________



Top
#125859 - 2004-08-30 04:37 PM Re: Log if File-System is FAT32 or NTFS
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
> but ... is FSO intrinsic in NT ??

HELP :-) Whats FSO ???

Luziekix

Top
#125860 - 2004-08-30 05:06 PM Re: Log if File-System is FAT32 or NTFS
Anonymous
Unregistered


this is a batch-file from this site.

Code:

@ECHO OFF
:: Windows NT 4 / 2000 only
IF NOT "%OS%"=="Windows_NT" 1 GOTO Syntax

:: Keep variables local
SETLOCAL ENABLEEXTENSIONS

:: Parameter check
ECHO.%1 | FIND "?" >NUL
IF NOT ERRORLEVEL 1 GOTO Syntax
:: Extract drive letter
SET Drive=%1
IF DEFINED Drive SET Drive=%Drive:~0,1%
CALL :Drive %Drive%:

:: FAT
SET FS=FAT
:: Test "last accessed"time, if 00:00 for every file we may presume FAT
FOR /F "TOKENS=2,3* DELIMS= " %%A IN ('DIR/A/TA/P/-P/W/-W %Drive% 2^>NUL ^| FIND ":" ^| FIND "-"') DO IF NOT "%%A"=="00:00" SET FS=
DIR %Drive% >NUL 2>&1
IF ERRORLEVEL 1 GOTO NotReady
IF NOT "%FS%"=="" GOTO Display

:: NTFS
SET FS=NTFS
:: NTFS check needs a temporary file name
SET TEMPFILE=
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO FOR %%B IN (0 1 2 3 4 5 6 7 8 9) DO CALL :TempFile %%A%%B %1
IF "%TEMPFILE%"=="" GOTO NoTemp
:: Test alternate data streams, a feature unique for NTFS
(ECHO %~nx0 > %TEMPFILE%:NTFSTEST) >NUL 2>&1
IF NOT EXIST %TEMPFILE% SET FS=unknown
IF EXIST %TEMPFILE% DEL %TEMPFILE%


:Display
ECHO.
ECHO File system of drive %Drive% is %FS%
GOTO End


:Drive
SET Drive=%~d1
goto:EOF


:TempFile
IF NOT "%TEMPFILE%"=="" GOTO:EOF
IF NOT EXIST %~d2\%~n0.%1$ SET TEMPFILE=%~d2\%~n0.%1$
GOTO:EOF


:NoTemp
ECHO.
ECHO Unable to create a temporary file for the NTFS check.
ECHO Temporary file names %Drive%\%~n0.00$ through %Drive%\%~n0.99$
ECHO all seem to be in use already.
GOTO End


:NotReady
ECHO.
ECHO Drive %Drive% is not ready
GOTO End


:Syntax
ECHO.
ECHO FileSys, Version 4.00 for Windows NT 4 / 2000
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
ECHO.
ECHO Usage: FILESYS [ drive ]
ECHO.
ECHO If no drive is specified, current drive is assumed
GOTO End


:End
ENDLOCAL


Top
#125861 - 2004-09-02 10:04 AM Re: Log if File-System is FAT32 or NTFS
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
Hi,

the Script "FILESYS" you posted is not working correctly
on out Win2k-machines. It shows
"File system of drive C: is unknown" or
wrong: "File system of drive C: is NTFS"
while the Filesystem on the harddrive C: is FAT32 !!!



Luziekix

Top
#125862 - 2004-09-02 02:28 PM Re: Log if File-System is FAT32 or NTFS
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Why go through all of this when you can use -

WMIQUERY() UDF

and then.. querying:
Win32_LogicalDisk
FileSystem

Thanks!

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#125863 - 2004-09-02 02:55 PM Re: Log if File-System is FAT32 or NTFS
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Kent,
I'm guessing you missed this post.
Quote:

Ey, sorry, ... I think the last uses WSH,
and this sadly isnīt available on our NT4-machines too ...

Luziekix





Still don't know why FSO would not work for him.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#125864 - 2004-09-02 03:07 PM Re: Log if File-System is FAT32 or NTFS
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I went back through and re-read it. I thought your response was most timely with the fso.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#125865 - 2004-09-02 03:18 PM Re: Log if File-System is FAT32 or NTFS
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
While the quote refers to WSH and NT4, I figured that you could read between the lines and assume that WMI would not be installed on those NT4 boxes.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 220 anonymous users online.
Newest Members
dimi575, Drecksnacken, Nlill, webtools321, multiman
17734 Registered Users

Generated in 0.043 seconds in which 0.012 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org