How can I create a file to fill up the disk via cmd?

explanation

As an IT administrator, you may need to create a file to fill up a disk drive via the command line. This is often a necessary step in order to test out a system or to ensure that it is functioning properly. In this article, we will discuss the steps necessary to create a file to fill up a disk drive via the command line.

The first step is to open the command prompt. This can be done by pressing the Windows key + R and typing “cmd” into the Run window. Once the command prompt is open, you can type the following command to create the file:

fsutil file createnew

Replace “” with the name of the file you want to create and replace “” with the size of the file you want to create. For example, if you wanted to create a file called “test.txt” that was 1GB in size, you would type:

fsutil file createnew test.txt 1073741824

This command will create a file called “test.txt” with a size of 1GB.

Once the file is created, you can use the following command to fill the file with data:

fsutil file setvaliddata

Replace “” with the name of the file you just created and replace “” with the size of the file. For example, if you had just created a file called “test.txt” that was 1GB in size, you would type:

fsutil file setvaliddata test.txt 1073741824

This command will fill the file with data.

Once the file is filled with data, you can use the following command to copy the file to the disk drive you want to fill:

copy

Replace “” with the name of the file you just created and replace “” with the path of the disk drive you want to fill. For example, if you had just created a file called “test.txt” and you wanted to copy it to the “C:” drive, you would type:

copy test.txt C:\\

This command will copy the file to the “C:” drive.

Once the file is copied to the disk drive, you can use the following command to verify that the file is filling up the disk drive:

dir

Replace “” with the path of the disk drive you just copied the file to. For example, if you had just copied the file to the “C:” drive, you would type:

dir C:\\

This command will list the files and folders on the “C:” drive.

Once the file is listed, you can use the following command to check the size of the file:

dir /s

Replace “” with the name of the file you just created. For example, if you had just created a file called “test.txt”, you would type:

dir /s test.txt

This command will list the size of the file.

Once you have verified that the file is filling up the disk drive, you can use the following command to delete the file:

del

Replace “” with the name of the file you just created. For example, if you had just created a file called “test.txt”, you would type:

del test.txt

This command will delete the file.

In summary, creating a file to fill up a disk drive via the command line is a relatively simple task. All you need to do is open the command prompt, use the fsutil command to create and set the size of the file, copy the file to the disk drive, check the file size, and then delete the file. With these steps, you can easily create a file to fill up a disk drive via the command line.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo