mohji32
Goto Top

Batch "copy" Netzlaufwerk

Wenn ich folgenden Befehl in die cmd eintippe : copy A:M.Müller\test.txt C:\Users\%Username%\Daten\test.txt
macht er genau was er soll. Die Testdatei aus dem Netzlaufwerk A auf den Desktop kopieren.
Schreibe ich den Befehl genau so in eine *.bat kommt eine Fehlermeldung das der Pfad nicht gefunden werden konnte.
Warum? Was ist daran falsch?

Content-Key: 358315

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

Ausgedruckt am: 28.03.2024 um 10:03 Uhr

Mitglied: 134998
134998 15.12.2017 aktualisiert um 11:26:35 Uhr
Goto Top
A:M.Müller\test.txt
Missing backslash.

If you run this in task scheduler not with your current account, the network drive won't be mapped and therefore your the path is not available, because network drives are mapped only for the specific user account. You should use UNC Paths wherever possible.

Best regards
Tom
Mitglied: Mohji32
Mohji32 15.12.2017 um 11:38:38 Uhr
Goto Top
But I cant use UNC for example "\\server\Folder"
Mitglied: 134998
Lösung 134998 15.12.2017 aktualisiert um 11:41:40 Uhr
Goto Top
Zitat von @Mohji32:
But I cant use UNC for example "\\server\Folder"
Sure you can! Try it yourself ...
copy "\\Server\folder\test.txt" "%userprofile%\Daten"  
Mitglied: Mohji32
Mohji32 15.12.2017 aktualisiert um 11:42:23 Uhr
Goto Top
LoL iam dumb xD It works *yay* :D Thank you <3