Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9202

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

$
0
0

I want to fill up the disk for a test which requires the disk storage to be full. For this, I found that I could use the command line with the following command: fsutil file createnew <filename> <filesize in bytes>. Combined with fsutil volume diskfree <disk> to find out how much space is currently available this is fine so far and it works for the use case.

Now I have the question, can I somehow combine these commands, so that it can be "automated" in a way, that I don't have to manually check for the free storage and create the file accordingly?

In short, can somehow combine the output from fsutil volume diskfree with the input of fsutil file createnew to create a file that fills up the disk? Does a "one-liner" solution in cmd (or alternatively power shell) exist for this task?

OS in question is Win10 Enterprise.


Viewing all articles
Browse latest Browse all 9202

Trending Articles