Quickly create large file on a Windows system

前端 未结 23 2357
别那么骄傲
别那么骄傲 2020-12-07 06:35

In the same vein as Quickly create a large file on a Linux system, I\'d like to quickly create a large file on a Windows system. By large I\'m thinking 5 GB.

23条回答
  •  佛祖请我去吃肉
    2020-12-07 07:21

    PowerShell one-liner to create a file in C:\Temp to fill disk C: leaving only 10 MB:

    [io.file]::Create("C:\temp\bigblob.txt").SetLength((gwmi Win32_LogicalDisk -Filter "DeviceID='C:'").FreeSpace - 10MB).Close
    

提交回复
热议问题