Batch file to determine if your HD is NTFS if not Format:FTFS

G

Guest

G'day, I am trying to write a batch file that will run on
a bootdisk. This batch file will be able to tell if your
Hard drive is formated NTFS and if it isn't it will
format it NTFS. Something like "if not NTFS format c:\
FS:NTFS"
Thanks for all your help
Adam
 
W

wadester

G'day, I am trying to write a batch file that will run on
a bootdisk. This batch file will be able to tell if your
Hard drive is formated NTFS and if it isn't it will
format it NTFS. Something like "if not NTFS format c:\
FS:NTFS"
Thanks for all your help
Adam

Under XP, you can use:
set volname=c:\
for /f "tokens=4 delims=: " %i in ('fsutil fsinfo volumeinfo %
volname% ^| findstr /c:"File System Name"') do set filesystem=%i
if /i not %filesystem%==ntfs convert %volname% /fs:ntfs

Double the % in a batch file.

Under W2K, you'll probably need to use WMI or somesuch to get the
file system type.

ws
 
M

Matthias Tacke

wadester said:
Under XP, you can use:
set volname=c:\
for /f "tokens=4 delims=: " %i in ('fsutil fsinfo volumeinfo %
volname% ^| findstr /c:"File System Name"') do set filesystem=%i
if /i not %filesystem%==ntfs convert %volname% /fs:ntfs

Double the % in a batch file.

Under W2K, you'll probably need to use WMI or somesuch to get the
file system type.
Or use chkntfs:

chkntfs c:|find /I "fat" && echo fat found || echo fat not found


replace the echo with convert like the above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top