1

Using a batch file I'm trying to copy and then move a file from a local FTP folder to my pc. To access the local FTP I use the administration user and password. This how it looks.

net use Z: "\\servername\FTP Folders\otherfolder" password /USER:domain\administrator


copy Test.txt C:\Users\username\Desktop\ProcessVault\Test.txt

move /y \\servername\FTP Folders\otherfolder\test.txt C:\Users\username\Desktop\folder\May\Test.txt

pause

The file copy works properly but the move is not working. Cant figure out why this is not working. This appears after I run the batch file.

"System error 1219 has occurred. Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again."

Any idea why I can't move the file?

wazoox
  • 6,918
  • 4
  • 31
  • 63
M.Vielma
  • 11
  • 1
  • Not related to _System error 1219_ but all paths with spaces should be enclosed in a pair of double quotes e.g. `move /y "\\servername\FTP Folders\otherfolder\test.txt" …` – JosefZ May 18 '17 at 20:01
  • Thanks for the tip that actually fix my move problem. Didn't know that all paths with spaces needed the quotes. – M.Vielma May 18 '17 at 20:48

1 Answers1

1

Rather than using "net use" to authenticate and map a drive, try using "cmdkey /add:servername /user:domain\user /pass:password"

Do your copy and then execute "cmdkey.exe /delete:servername"

Also consider using "robocopy.exe" with the "/move" switch. Robocopy is much more "robo"ust than the move or copy commands and will repeatedly try to copy the file until it is closed.

Note that the FTP server will keep the file open until it is entirely received so that you don't get a partial file and blame the server.

nutcase
  • 80
  • 7