lauchheimer
Goto Top

Xcopy Batch-Datei

Tag Leute,

Ich habe in einer Batchdatei einen xcopy-Befehl. Dieser soll eine bestimmte Datei kopieren. Diesen führe ich mit Zusatz Y aus, damit er ungefragt die Datei überschreibt.
Jetzt kommt jedoch jedes Mal die Frage ob es sich um ein Verzeichnis oder eine Datei handelt.

Wie bekomme ich diese Abfrage noch weg?

Schönen Gruß

Martin

Content-Key: 314413

Url: https://administrator.de/contentid/314413

Printed on: April 20, 2024 at 00:04 o'clock

Member: IrunGoldstein
IrunGoldstein Sep 04, 2016 at 08:38:06 (UTC)
Goto Top
Hi,

eine von unterschiedlichen Möglichkeiten:

echo f | xcopy /Y [Quell Pfad] [Ziel Pfad]

Grüße
Mitglied: 129813
Solution 129813 Sep 04, 2016 updated at 09:14:10 (UTC)
Goto Top
You forgot to set the parameter /i
https://www.microsoft.com/resources/documentation/windows/xp/all/proddoc ...
/i - Source is a directory or contains wildcards and Destination does not exist, xcopy assumes destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory.
But I would rather use robocopy instead of xcopy ...

Regards
Member: Lauchheimer
Lauchheimer Sep 06, 2016 at 11:27:46 (UTC)
Goto Top
Mit "i" hat es funktioniert.

Vielen Dank.
Schöne Grüße

Martin