2017-12-21 1 views
0

Haben Sie Probleme mit cmd Prompt Befehl:Befehlszeile verschieben Sie alle Dateien bestimmter Typen mit NO-Überschreibungs/y FUNKTIONIERT NICHT

for /r E:\ %f in (*.jpg) do @move "%f" "E:\jpg" /Y 

Diese Befehlszeile funktioniert nicht so, wie ich es gedacht. Ich versuche, alle Dateien auf meinem externen Laufwerk eines bestimmten Typs (z. B. jpg) in einen Ordner auf meinem externen Laufwerk (E:/jpg)

Irgendwelche Vorschläge ???

1. (with /Y)

Microsoft Windows [Version 10.0.16299.125] 
(c) 2017 Microsoft Corporation. All rights reserved. 

C:\Users\█████>for /r E:\ %f in (*.jpg) do @move "%f" "E:\jpg" /Y 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 

2. (without /Y)

Microsoft Windows [Version 10.0.16299.125] 
(c) 2017 Microsoft Corporation. All rights reserved. 

C:\Users\█████>for /r E:\ %f in (*.jpg) do @move "%f" "E:\jpg" 
Overwrite E:\jpg\10255420_10200945699085042_5035519864603771578_n.jpg? (Yes/No/All): Yes 
     1 file(s) moved. 
Overwrite E:\jpg\10307411_10201163984180409_2977646430196181302_n.jpg? (Yes/No/All): 
+1

Wenn Sie die '@' Sie entfernen wird sehen, dass der Befehl ausgeführt wird. – ACatInLove

+1

lesen Sie die Ausgabe von 'move /?' Und korrigieren Sie die Syntax. (Notieren Sie die Position des swich) – Stephan

+1

Sie müssen auch sicherstellen, dass jede kopierte Datei '.jpg' in' E: \ jpg' nicht zurückgenommen wird up durch '(* .jpg)' und 'Überschreiben' 'bewegen sich über sich selbst und erzeugen einen endlosen Zyklus. Ich bemerke, dass Sie Dateien aus '$ RECYCLE.BIN's' verschieben '; um sicherer zu sein, würde ich vorschlagen, dass 'cmd.exe'' Run as administrator' ist. – Compo

Antwort

0

Für Dateien bewegen Sie Robocopy statt bewegen können, standardmäßig ist es nicht Dateien am Zielort überschreiben, wenn sie unterschiedliche Größen oder Zeitstempel haben, und behandelt mehrere Dateien.

Sie sollten mit

robocopy %cd% "E:\jpg" *.jpg /MOV

Notiz eine Zeile es in der Lage sein: cd die Umgebungsvariable für das aktuelle Verzeichnis ist

https://ss64.com/nt/robocopy.html siehe

Verwandte Themen