#125848 - 2004-08-30 02:25 PM
Log if File-System is FAT32 or NTFS
|
Anonymous
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
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.
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
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
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
Hi,
will WMI run on NT4 without install/adding something ?
Regards,
Luziekix
|
Top
|
|
|
|
#125854 - 2004-08-30 03:28 PM
Re: Log if File-System is FAT32 or NTFS
|
Anonymous
Anonymous
Unregistered
|
|
Top
|
|
|
|
#125855 - 2004-08-30 03:30 PM
Re: Log if File-System is FAT32 or NTFS
|
Luziekix
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
|
|
|
|
#125857 - 2004-08-30 03:40 PM
Re: Log if File-System is FAT32 or NTFS
|
Luziekix
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
|
|
|
|
#125859 - 2004-08-30 04:37 PM
Re: Log if File-System is FAT32 or NTFS
|
Luziekix
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
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
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
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
|
Top
|
|
|
|
#125864 - 2004-09-02 03:07 PM
Re: Log if File-System is FAT32 or NTFS
|
Kdyer
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
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 382 anonymous users online.
|
|
|