大网数据广告活动
Windows排障命令

freedisk

· 52CE 我爱测

Reference article for the freedisk command, which checks to see if the specified amount of disk space is available before continuing with an installation process.

Checks to see if the specified amount of disk space is available before continuing with an installation process.

Syntax

freedisk [/s <computer> [/u [<domain>\]<user> [/p [<password>]]]] [/d <drive>] [<value>]

Parameters

Parameter Description
/s <computer> Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. This parameter applies to all files and folders specified in the command.
/u [<domain>\]<user> Runs the script with the permissions of the specified user account. The default is system permissions.
/p [<password>] Specifies the password of the user account that is specified in /u.
/d <drive> Specifies the drive for which you want to find out the availability of free space. You must specify <drive> for a remote computer.
<value> Checks for a specific amount of free disk space. You can specify <value> in bytes, KB, MB, GB, TB, PB, EB, ZB, or YB.
Remarks
  • Using the /s, /u, and /p command-line options are available only when you use /s. You must use /p with /uto provide the user's password.

  • For unattended installations, you can use freedisk in installation batch files to check for the prerequisite amount free space before continuing with the installation.

  • When you use freedisk in a batch file, it returns a 0 if there's enough space and a 1 if there's not enough space.

Examples

To determine whether there are at least 50 MB of free space available on drive C, type:

freedisk 50mb

Output similar to the following example appears on the screen:

INFO: The specified 52,428,800 byte(s) of free space is available on current drive.

Related links

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 10/16/2017
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。