Windows platform quickly creates a file of the specified size

Source: Internet
Author: User

Sometimes, we need to quickly create a file of a specified size, for system testing, we specify that the following commands can be used in the Linux platform:

Create a 100M empty file

DD If=/dev/zero of=hello.txt bs=100m count=1


You can also quickly create a file of a specified size using the following commands on the Windows platform:

fsutil file createnew <filename> <length>

C:\>fsutil file CreateNew
Usage: fsutil file createnew <filename> <length>
For example: fsutil file createnew C:\testfile.txt 1024 Create a 1kb size files


C:\>fsutil
----Supported commands----

8dot3name       8dot3name Administration
behavior         Control file system behavior
dirty           the number of corrupted bits in the managed volume
file             file-specific commands
fsinfo           file System Information
hardlink        hard link Management
objectid         Object ID Management
quota            Quota management
repair          self-healing management
reparsepoint     Analysis Point Management
resource        Transaction Explorer Management
sparse           sparse File Control
transaction     transaction Management
usn              USN Management
volume           Volume management

C:\>fsutil file?
----the supported FILE commands----

Findbysid locating files by security identifier
Queryallocranges the allocation scope of the query file
Setshortname the short name of the settings file
Setvaliddata valid data length for the settings file
Setzerodata 0 Data for the setup file
CreateNew Create a new file of the specified size
Queryfileid querying the file ID of the specified file
Queryfilenamebyid a random link name showing the file ID

This article is from the "Eddy Technology blog" blog, please be sure to keep this source http://gongeddy.blog.51cto.com/2993788/1550361

Windows platform quickly creates a file of the specified size

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.