海东市乐都区图片:如何让DOS命令不在需要确认就可直接执行

来源:百度文库 编辑:中科新闻网 时间:2024/05/04 02:55:56
好多DOS命令为了安全,都需要在输如"Y"确认后方可执行,比如用format命令格式化磁盘、用label删除卷标时等等,但这在批处理中却显的相当麻烦,有什么办法可以让不用确认就直接执行吗?

随便问问,如果格式化有卷标的磁盘,如何不用提示输入当前卷标就可直接执行格式化

Formats a disk for use with Windows 2000.

FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X]
FORMAT volume [/V:label] [/Q] [/F:size]
FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors]
FORMAT volume [/V:label] [/Q] [/1] [/4]
FORMAT volume [/Q] [/1] [/4] [/8]

volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:filesystem Specifies the type of the file system (FAT, FAT32, or NTFS).
/V:label Specifies the volume label.
/Q Performs a quick format.
/C Files created on the new volume will be compressed by
default.
/X Forces the volume to dismount first if necessary. All opened
handles to the volume would no longer be valid.
/A:size Overrides the default allocation unit size. Default settings
are strongly recommended for general use.
NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
(128K, 256K for sector size > 512 bytes).
FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
(128K, 256K for sector size > 512 bytes).

Note that the FAT and FAT32 files systems impose the
following restrictions on the number of clusters on a volume:

FAT: Number of clusters <= 65526
FAT32: 65526 < Number of clusters < 268435446

Format will immediately stop processing if it decides that
the above requirements cannot be met using the specified
cluster size.

NTFS compression is not supported for allocation unit sizes
above 4096.
/F:size Specifies the size of the floppy disk to format (160,
180, 320, 360, 640, 720, 1.2, 1.23, 1.44, 2.88, or 20.8).
/T:tracks Specifies the number of tracks per disk side.
/N:sectors Specifies the number of sectors per track.
/1 Formats a single side of a floppy disk.
/4 Formats a 5.25-inch 360K floppy disk in a
high-density drive.
/8 Formats eight sectors per track.

以上是FORMAT命令的用法,可以看出不可以跳过卷标而进行格式化.
在某些DOS命令后加"-y"参数可能跳过y键确认.

建立一个批处理文件,把你一次需要执行的命令写在里面,使用时只要双击这个批处理文件,它的执行就不用确认了(直到它执行完为止)

在命令后面加参数 /q 就可以强制执行了把。