|
Log if File-System is FAT32 or NTFS
|
|
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
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
On what sort of machines? W95? W98? W2K? WXP? Mixed?
|
Chris S.
|
(MM club member)
|
2004-08-30 03:11 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
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
|
Luziekix
|
(Getting the hang of it)
|
2004-08-30 03:19 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
> 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
|
Luziekix
|
(Getting the hang of it)
|
2004-08-30 03:21 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
Hi,
will WMI run on NT4 without install/adding something ?
Regards,
Luziekix
|
Chris S.
|
(MM club member)
|
2004-08-30 03:24 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
You would have to install WMI on NT4-based machines, yes.
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
NT4 WMI installer
|
Luziekix
|
(Getting the hang of it)
|
2004-08-30 03:30 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
OK, thanks,
anyone having a way without the need to
install WMI on our NT4-machines ?!
Regards,
Luziekix
|
Les
|
(KiX Master)
|
2004-08-30 03:35 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
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
|
Luziekix
|
(Getting the hang of it)
|
2004-08-30 03:40 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
Ey, sorry, ... I think the last uses WSH, and this sadly isnīt available on our NT4-machines too ...
Luziekix
|
Jochen
|
(KiX Supporter)
|
2004-08-30 03:40 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
but ... is FSO intrinsic in NT ??
|
Luziekix
|
(Getting the hang of it)
|
2004-08-30 04:37 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
> but ... is FSO intrinsic in NT ??
HELP :-) Whats FSO ???
Luziekix
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
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
|
Luziekix
|
(Getting the hang of it)
|
2004-09-02 10:04 AM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
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
|
Kdyer
|
(KiX Supporter)
|
2004-09-02 02:28 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
Why go through all of this when you can use -
WMIQUERY() UDF
and then.. querying: Win32_LogicalDisk FileSystem
Thanks!
Kent
|
Les
|
(KiX Master)
|
2004-09-02 02:55 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
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.
|
Kdyer
|
(KiX Supporter)
|
2004-09-02 03:07 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
I went back through and re-read it. I thought your response was most timely with the fso.
Kent
|
Les
|
(KiX Master)
|
2004-09-02 03:18 PM
|
|
|
|
|
Re: Log if File-System is FAT32 or NTFS
|
|
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.
|