135012
Dec 15, 2017
9416
4
0
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?
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?
Please also mark the comments that contributed to the solution of the article
Content-Key: 358315
Url: https://administrator.de/contentid/358315
Printed on: April 19, 2024 at 04:04 o'clock
4 Comments
Latest comment
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
Zitat von @135012:
But I cant use UNC for example "\\server\Folder"
Sure you can! Try it yourself ...But I cant use UNC for example "\\server\Folder"
copy "\\Server\folder\test.txt" "%userprofile%\Daten"