Para said the old DOS 2

Source: Internet
Author: User
Keywords Old Tree New Flower
Command: Freedisk

function: Check for a specified amount of free disk space before continuing to run the next program.

Syntax: freedisk [/s Computer [/u [domain\]user [/P [Password]]] [/D Drive] [Value]

Parameters: "/d Drive" Specifies the drive to query for disk space availability; "Value" checks for a specified amount of free disk space, which can be in bytes, KB, MB, GB, TB, and so on.

For unattended installations, you can use the Freedisk command in a batch file installation to check for available disk space before continuing the installation.

When you use the Freedisk command in a batch file, if there is enough space, the command returns 0, otherwise it returns 1. We can use this return value to control the running of the following program.

① assume that we want to determine whether there is at least 5GB of free space on drive C, and then enter "Freedisk/d C:5GB" at the command prompt to verify that the free space is sufficient.

② using this command, we can add the space check function for the software we designed. Assume that the design of the Software Master execution program, the program name is Mysoftware.exe, the default installation on D disk, the need for space 500MB. Now open Notepad,

Enter the following:

FREEDISK/D D:500MB

If not errorlevel 1 goto install

The echo the space is not enough to install this software

Goto END

: Install

Start MySoftware

Goto END

: End

Then click program → Save As, select All files after save type, enter "X.bat" after "File name" (X represents any file name, such as we can set to Setup.bat), so a batch file named X.bat is built. Run (double click) What effect does it have? If the rest of the D disk is more than 500MB, the installer will automatically run, otherwise the "the" is not enough to install this software, the installer automatically quits.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.