MSFT_Volume 类的 Format 方法

设置卷的格式。

语法

UInt32 Format(
  [in]  String  FileSystem,
  [in]  String  FileSystemLabel,
  [in]  UInt32  AllocationUnitSize,
  [in]  Boolean Full,
  [in]  Boolean Force,
  [in]  Boolean Compress,
  [in]  Boolean ShortFileNameSupport,
  [in]  Boolean SetIntegrityStreams,
  [in]  Boolean UseLargeFRS,
  [in]  Boolean DisableHeatGathering,
  [out] String  FormattedVolume,
  [out] String  ExtendedStatus
);

参数

FileSystem [in]

要应用于卷的文件系统。 下列类型作之一:

  • “ExFAT”
  • “FAT”
  • “FAT32”
  • “NTFS”
  • “ReFS”

FileSystemLabel [in]

卷的文件系统标签。

AllocationUnitSize [in]

分配单元大小(以字节为单位)。

完整 [in]

TRUE 表示完整格式,对于快速格式, 则为 FALSE

强制 [in]

如果为 TRUE ,则强制执行格式操作;否则为 FALSE

压缩 [in]

如果为 TRUE ,则压缩卷;否则为 FALSE。 如果 FileSystem 设置为 ReFS ,则保留未定义。

ShortFileNameSupport [in]

如果卷应支持短名称,则为 TRUE;否则为 FALSE。 如果 FileSystem 设置为 ReFS ,则保留未定义。

SetIntegrityStreams [in]

如果为 TRUE ,则设置完整性流。 除非 FileSystem 设置为 ReFS ,否则保留未定义。

UseLargeFRS [in]

如果为 TRUE ,则使用大型 FRS;否则为 FALSE。 如果 FileSystem 设置为 ReFS ,则保留未定义。

DisableHeatGathering [in]

如果为 TRUE ,则禁用热收集;否则为 FALSE

FormattedVolume [out]

接收表示格式化卷 的 MSFT_Volume 对象。

ExtendedStatus [out]

包含嵌入 MSFT_StorageExtendedStatus 对象。

此参数允许存储提供程序返回特定于实现的扩展 () 错误信息。

返回值

成功 (0)

不支持 (1)

未指定的错误 (2)

超时 (3)

失败 (4)

参数 (5) 无效

在 x64 环境中运行的 x86 不支持此命令。 (7)

拒绝访问 (40001)

(40004) 发生意外的 I/O 错误

指定的对象由 Microsoft 故障转移群集组件管理。 磁盘必须处于群集维护模式,并且群集资源状态必须处于联机状态才能执行此操作。 (40018)

不允许在系统或关键分区上执行该操作。 (42010)

指定的群集大小无效 (43000)

43001 (不支持指定的文件系统)

卷无法快速格式化 (43002)

群集数超过 32 位 (43003)

43004 (不支持指定的 UDF 版本)

群集大小必须是磁盘物理扇区大小的倍 数, (43005)

当驱动器为只读 (43006)

要求

要求
最低受支持的客户端 Windows 8 [仅限桌面应用]
最低受支持的服务器 Windows Server 2012 [仅限桌面应用]
命名空间 Root\Microsoft\Windows\Storage
MOF Storagewmi.mof

另请参阅

MSFT_Volume