Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a batch file which uses a move command to pull files from another computer:

move \\otherpc\source\directory\*.bin c:\destination\

Normally, if there are indeed no files which match the pattern move will print:

A duplicate file name exists, or the file cannot be found.

If the other computer could not be found/reached, it would print:

The network path was not found.

But I have a move command which returned:

0 file(s) moved.

Notes:

  • There are files which match the pattern
  • The destination folder does exist
  • The user has read-write privileges on both directories (source and destination)
  • None of the files are read-only.
  • The destination drive is not full.

What else am I missing? What could cause a move to behave like this?

share|improve this question
    
What if you wrap the source in quotation marks? It's possible that there's a .bin file that contains a space or a strange character. –  user3463 May 29 '12 at 2:16
1  
just try listing files in that directory with dir to make sure that command prompt is able to detect files eligible for moving –  tumchaaditya May 29 '12 at 2:43
    
@RandolphWest They should not, plain ascii and all legal characters, but I will try. –  MPelletier May 29 '12 at 3:45
add comment

1 Answer

I'm not quite sure what is causing your problems, but I do know about a potential fix: robocopy

move has been around since DOS times and hasn't changed much since. Along with xcopy, it's superseeded by the new and improved robocopy. The latter is much more versatile, and a little less buggy in some cases (networking being one of them).

From robocopy /?:

      Usage :: ROBOCOPY source destination [file [file]...] [options]

     source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir  (drive:\path or \\server\share\path).
       file :: File(s) to copy  (names/wildcards: default is "*.*").

        ...

       /MOV :: MOVe files (delete from source after copying).
      /MOVE :: MOVE files AND dirs (delete from source after copying).

This commmand is the equivalent to your move command:

robocopy \\otherpc\source\directory c:\destination *.bin /mov

If that works, don't bother why move doesn't. If it doesn't, here's a couple of other potential problems and workarounds:

  • There's an open file handle on the source files.

  • The source files are corrupted.

  • The source files have improper names.

  • The other PC's OS and/or the file system isn't fully compatible isn't fully compatible with Windows.

  • You can always try to copy first and del on success. I never managed to understand why, but that works sometimes when move doesn't...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.