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

Ausgedruckt am: 19.03.2024 um 11:03 Uhr

Mitglied: IrunGoldstein
IrunGoldstein 04.09.2016 um 10:38:06 Uhr
Goto Top
Hi,

eine von unterschiedlichen Möglichkeiten:

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

Grüße
Mitglied: 129813
Lösung 129813 04.09.2016 aktualisiert um 11:14:10 Uhr
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
Mitglied: Lauchheimer
Lauchheimer 06.09.2016 um 13:27:46 Uhr
Goto Top
Mit "i" hat es funktioniert.

Vielen Dank.
Schöne Grüße

Martin