適用于: Windows Server (半年通道) 、Windows Server 2019、Windows Server 2016、Windows Server 2012 R2、Windows Server 2012Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

檢查是否有指定的可用磁碟空間量,再繼續進行安裝程式。Checks to see if the specified amount of disk space is available before continuing with an installation process.


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


參數Parameter 描述Description
/s <computer>/s <computer> 指定遠端電腦的名稱或 IP 位址 (不要使用反斜線) 。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>/u [<domain>\]<user> 使用指定之使用者帳戶的許可權來執行腳本。Runs the script with the permissions of the specified user account. 預設為系統許可權。The default is system permissions.
/p [ ]/p [] 指定 /u中指定之使用者帳戶的密碼。Specifies the password of the user account that is specified in /u.
/d <drive>/d <drive> 指定您想要找出可用空間可用性的磁片磁碟機。Specifies the drive for which you want to find out the availability of free space. 您必須 <drive> 為遠端電腦指定。You must specify <drive> for a remote computer.
<value> 檢查是否有特定的可用磁碟空間量。Checks for a specific amount of free disk space. 您可以指定 <value> 位元組、KB、MB、GB、TB、PB、EB、ZB 或 YB。You can specify <value> in bytes, KB, MB, GB, TB, PB, EB, ZB or YB.


  • 使用 /s/u/p 命令列選項時,只有在您使用 /s時才可使用。Using the /s, /u, and /p command-line options are available only when you use /s. 您必須使用 /p 搭配 /u來提供使用者的密碼。You must use /p with /uto provide the user s password.

  • 若為自動安裝,您可以在安裝批次檔中使用 freedisk 來檢查必要條件數量的可用空間,然後再繼續進行安裝。For unattended installations, you can use freedisk in installation batch files to check for the prerequisite amount free space before continuing with the installation.

  • 當您在批次檔中使用 freedisk 時,如果有足夠的空間,則會傳回 0 ,如果沒有足夠的空間,則會傳回 1When 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.


若要判斷磁片磁碟機 C:上是否至少有 50 MB 的可用空間,請輸入:To determine whether there are at least 50 MB of free space available on drive C:, type:

freedisk 50mb

畫面上會出現類似下列的輸出:Output similar to the following appears on the screen:

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

其他參考資料Additional References