Ich bin überrascht, den gleichen Fall von mir zu finden. Ich hatte 30.000 Dateien, die sortiert werden benötigt, so dass ich gestellte Frage auf dieser Seite: Fast methods to copy(move) files in batch file
Dies ist Compo ‚s Skript:
@Echo Off
If /I Not "%__CD__%"=="%~dp0" PushD "%~dp0" 2>Nul||Exit/B
SetLocal EnableDelayedExpansion
Set "DirN=-1"
:Check_DirN
Set/A "DirN+=1"
If Exist "%DirN%" GoTo Check_DirN
Set "limit=700"
For %%A In (*.bat *.cmd *.txt) Do (
If Not Exist "%DirN%" MD "%DirN%"
If /I Not "%%~nxA"=="%~nx0" RoboCopy . "%DirN%" "%%A" /MOV 1>NUL
Set/A "limit-=1"
If !limit! Lss 0 GoTo Check_DirN
)
Echo(Task Done!
Timeout -1 1>Nul
Und das ist, was ich benutze und ich bearbeitete für ein bisschen zum Zweck:
@Echo Off
If /I Not "%__CD__%"=="%~dp0" PushD "%~dp0" 2>Nul||Exit/B
taskkill /f /im explorer.exe >nul
taskkill /f /im SearchIndexer.exe >nul
sc stop WSearch >nul
sc config WSearch start= disabled >nul
SetLocal EnableDelayedExpansion
Set "DirN=-1"
:Check_DirN
Set/A "DirN+=1"
If Exist "%DirN%" GoTo Check_DirN
cls
echo Moving files to Directory %DirN%...
Set "limit=2999"
MD "%DirN%"
For %%A In (*.html) Do (
RoboCopy . "%DirN%" "%%A" /MOV 1>NUL
Set/A "limit-=1"
If !limit! Lss 0 GoTo Check_DirN
)
Echo(Task Done!
start explorer.exe
start SearchIndexer.exe
sc config WSearch start= delayed-auto >nul
sc start WSearch >nul
Timeout -1 1>Nul
Sieentfernen 210, start
und sc
Teil, falls gewünscht. Ich habe diesen Teil hinzugefügt, weil Explorer und Windows Search Indexer beim Verschieben von Dateien Speicherverschwendung verursachen. Ich empfehle Ihnen, das Skript mit Administratorrechten auszuführen.
Versuchen Sie das Skript in kleinem Maßstab zu testen, um zu sehen, ob es funktioniert.
siehe http://stackoverflow.com/questions/41489945/fast-methods-to-copymove-files-in-batch-file - ändern Sie einfach das 'limit' – Magoo
... und' "% DirN%" 'to' „NewFolder \ Sub% Dirn%“ ' – Compo
Sieht aus wie der neueste 2-Skripte einfach wiederholen sie die gleiche erste Charge von Dateien in verschiedenen Ordnern zu kopieren ... – greektranslator