How to Format unattended using a batch file.

  • Thread starter Thread starter Steve Schilz
  • Start date Start date
S

Steve Schilz

Hi all,

I was searching the newsgroup today, and noticed a request from Slobodan
Brcin last October for instructions on how to perform an unattended format,
i.e. the equivalent of Format C: /FS:NTFS /Y, to bypass the 'Are you sure'
prompt..

On the off chance that you haven't already figured this out, this should
work.
(I tested this using WinPE and a floppy disk to create batch files.)

Create a batch file and input file as follows:
NOTE: <CR> == A Carriage Return or Line break.

FILE: YES.INP (Text)
Contents: Y <CR>

BATCH FILE: Fmt.bat
Contents: Format C: /FS:NTFS /V:XPEmbedded < Yes.inp <CR>


Executing fmt.bat will then format c: unattended.

Steve Schilz
Innovative Imaging Inc.
StevesATeyeDASHImaging.Com
 
Steve,

Your input is appreciated.

However, I am just wondering why would you need such solution if you have
"/Y" switch for format utility (which has been know for a long while, btw).
Redirecting input is a good trick to be used in a batch. But it makes it
more complicated to automate through FBA - you will need an additional file
in your component and therefore you will need a Repository for your
component too. And all this is instead of one simple FBA generic command.

KM
 
Hi Steve,

To add something unrelated to Konstantin's reply.
You can automate diskpart command as well trough internal script and then bind diskpart and format in one batch file so your disk
can be formed always in the exactly the same way you wanted it.

If you want to make nice format GUI then you can use simple API FormatEx command described by Mark Russinovich.
http://www.sysinternals.com/ntw2k/source/fmifs.shtml

Best regards,
Slobodan
 
Hi all,

I was searching the newsgroup today, and noticed a request from
Slobodan Brcin last October for instructions on how to perform an
unattended format, i.e. the equivalent of Format C: /FS:NTFS /Y, to
bypass the 'Are you sure' prompt..

Try using:
format c: /fs:ntfs /v:BartPE /backup /force

This way it also works in other languages where "y" is not the correct
response.

Regards,
nu2Bart
 
Hi Bart,

Don't try using C:.

Try using:
format x: /fs:ntfs /v:BartPE /y

/y switch is undocumented but supported. (It should be same for all languages)
x: - should be volume letter that you want to format.


Best regards,
Slobodan
 
Back
Top