这样应该也可以- $Path = "D:\000\"
- $step=10 #50000
- $total=100 #600000
- for($i=0; $i -lt $total; $i++) {
- $start = [Math]::floor($i/$step)*$step + 1;
- $end = [Math]::floor($i/$step+1)*$step;
-
- $path_mkdir = $Path + $start + "-" + $end;
- $file = $path + ($i + 1) + '.txt';
-
- if( !(Test-Path $path_mkdir) ){
- mkdir $path_mkdir;
- }
- if( Test-Path $file ){
- mv -force $file ($path_mkdir + '\');
- }
- }
复制代码
|