简体   繁体   English

如何提高目录创建速度

[英]How to improve the speed of directory creation

I am wanting to create around 1000 folders onto a 16GB FAT32 USB but it takes around 1-2 minutes.我想在 16GB FAT32 USB 上创建大约 1000 个文件夹,但这需要大约 1-2 分钟。 That seems a little absurd for just directories.这对于目录来说似乎有点荒谬。 Are there any ways to speed this up?有什么方法可以加快速度吗?

I would look up other things to try but I have found nothing.我会查找其他东西来尝试,但我什么也没找到。 Changing from FAT32 to NTFS improves speed drastically but unfortunately I cannot use that.从 FAT32 更改为 NTFS 可大大提高速度,但不幸的是我无法使用它。 Currently I am testing out of powershell running a very basic for loop script to create directories.目前我正在测试运行一个非常基本的 for 循环脚本来创建目录的 powershell。

for ($i=1;$i -le 1000;$i++){MD "D:\$i"}

Any suggestions on how to improve this?关于如何改进这一点的任何建议?

If you are already in the directory where you want to create the folders, you can simply run the following because the -Path parameter accepts an array.如果您已经在要创建文件夹的目录中,则可以简单地运行以下命令,因为-Path参数接受一个数组。

new-item -itemtype directory -path (1..1000)

If significant time is wasted displaying output to the console, you can use $null to suppress that.如果在控制台上显示输出浪费了大量时间,您可以使用$null来抑制它。

$null = new-item -itemtype directory -path (1..1000)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM