China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-22 06:08
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Discussion] How to determine if it is a FAT32 or NTFS file system in batch processing? View 3,124 Replies 19
Original Poster Posted 2007-05-26 14:07 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
OK, first of all, thank you all for your guidance. I don't know if any senior has made a summary of this aspect. If there is, this post will be regarded as a supplement, which can also guide rookies like me. The summary is as follows:

(The following commands run on NT systems)

1. fsutil (must be logged in as a member of the administrator or administrator group to use): (See floor 3)

For example: for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get caption') do (
for /f "tokens=1,2 delims=:" %%a in ('fsutil fsinfo volumeinfo %%i\ ^| find "File System Name"') do echo %%i %%b
)

2. wmic (needs to be registered the first time used): (See floor 9)

For example: for /f "skip=1 tokens=1,2" %%i in ('"wmic logicaldisk get Caption,FileSystem"') do echo %%i %%j

3. chkntfs: (See floors 12, 20)

For example: for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get caption') do (
for /f "tokens=1,2 delims= " %%a in ('chkntfs %%i ^|find "Type of File System"') do echo %%i %%b
)

4. Tools like md or cacls: (See floor 14)

Can judge FAT or NTFS file systems, but it seems unable to confirm whether it is FAT32 or FAT16 and others.

(The following commands run on DOS systems)

1. 00000055 33 32
First get the DBR, then see if the two bytes at offset 55 are 0x33 0x32

(http://www.cn-dos.net/forum/viewthread.php?tid=21845&fpage=1&highlight=%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F —— Brother GOTOmsdos said so, this rookie has not tested)

(The following commands require third-party tools)

1. omnifs (a tool attached in the Ghost enterprise version, the current version is v11.0.01502) (See floors 11, 16)

In addition, the GDISK mentioned by moderator gmy is known to be a hard disk partitioning tool. Can it judge the file system type? Brothers who have used it please explain. I dare not write it down before confirming it, for fear of misleading others. Please forgive me.

If there are other methods, please continue to leave a post.

[ Last edited by qinbuer on 2007-7-12 at 01:07 AM ]
Floor 2 Posted 2007-05-26 14:26 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
Floor 3 Posted 2007-05-26 14:42 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
If it is a system above XP, try this:
fsutil fsinfo volumeinfo c:\|find "File System Name"
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
qinbuer +2 2007-05-26 15:03
Floor 4 Posted 2007-05-26 14:47 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
Floor 5 Posted 2007-05-26 14:48 ·  中国 北京 联通
中级用户
★★
替身
Credits 269
Posts 130
Joined 2007-03-23 21:41
19-year member
UID 82683
Gender Female
Status Offline
Sorry, I interrupted your discussion about the fsutil command.

[ Last edited by ansipeter on 2007-5-26 at 03:43 PM ]
Floor 6 Posted 2007-05-26 14:58 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
This command can determine whether it is a removable drive or a fixed drive. Does that mean it can be used to detect whether a mobile medium such as a USB flash drive is inserted?
Floor 7 Posted 2007-05-26 15:02 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
Thanks everyone. The command mentioned in my above question refers to fsutil fsinfo
Floor 8 Posted 2007-05-26 16:03 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
This fsutil fsinfo command needs to specify the drive, which is not very convenient. Using wmic is better.
Floor 9 Posted 2007-05-26 16:25 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
Learned from the moderator:
@echo off
for /f "skip=1 tokens=1,2" %%i in ('"wmic logicaldisk get Caption,FileSystem"') do echo %%i %%j
pause
Floor 10 Posted 2007-05-29 14:09 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
我确实是只菜鸟,而且这里X人太多,所以我不敢装X。谁要再说我装X,我就XXOO他。
Floor 11 Posted 2007-05-30 21:33 ·  中国 山西 移动
初级用户
★★
Credits 172
Posts 88
Joined 2006-12-08 10:47
19-year member
UID 72923
Gender Male
Status Offline
The simplest method:
@echo off
omnifs info >disk.txt
Open the text file disk.txt and it's clear at a glance!
Floor 12 Posted 2007-05-30 21:40 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 13 Posted 2007-05-30 22:31 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Originally posted by XiaoGuDong at 2007-5-30 21:33:
The simplest method:
@echo off
omnifs info >disk.txt
Open the text file disk.txt to see at a glance!

Is this a method tool? Can you upload one?
Floor 14 Posted 2007-05-30 22:33 ·  中国 广东 茂名 电信
初级用户
Credits 42
Posts 23
Joined 2006-02-13 04:23
20-year member
UID 50270
Status Offline
Use md...\ to determine that FAT32 can be created, but NTFS cannot
我是allyesno 帐号忘记密码了 妈的
Floor 15 Posted 2007-05-31 09:17 ·  中国 河北 唐山 联通
版主
★★★
操作系统爱好者
Credits 1,113
Posts 392
Joined 2002-11-11 00:00
23-year member
UID 228
Gender Male
Status Offline
DOS之家 http://doshome.com 站长 葛明阳
Forum Jump: