11

Hi there i'm using the windows 7 'move' command like so:

move /Y "C:\old.sub.folder\folder.i.want.to.move" "F:\new.sub.folder\folder.i.want.to.move"

and i keep getting an 'accessed denied' error yet i have full permissions and the folder i'm trying to move isn't open or being uses?

a random example trying to move one empty folder to another: http://puu.sh/2Rx6b.png

any ideas?

thanks

| improve this question | |
9

Or you could try robocopy with /MOVE argument:

robocopy C:\old\folder F:\new\folder /E /MOVE
| improve this answer | |
  • Does robocopy /move move the files the same way the move command or explorer does, or does it copy and then delete? I get access denied when using os.system in python with the move command (although I think Python can move files without having to run system commands). I changed it to robocopy and it's taking a while. – user742864 Jul 14 '16 at 4:22
  • 6
    no, it doesn't. move doesn't touch the file itself, it only changes the file allocation table. This is why move can't move a file to another drive. Any move to another drive must make a copy – Stephan Jul 14 '16 at 7:51
6

Syntax is:

MOVE [/Y| /-Y] [Drive:][Path]Folder1 Folder2

That means, you can rename one folder, but you cannot "move" contents to another drive.

I'm afraid, you have to copy your source-folder to the destination-folder (xcopy) and then delete the source-folder

| improve this answer | |
  • 1
    i don't understand though why can the move command move files but not folders? isn't there a command to move the folder? i don't mind using a separate exe for this if need be :) – steve May 12 '13 at 12:05
  • 2
    @Stephan copy/delete takes ages when you're moving many gig. It also wastes your hard drives life with the completely unnecessary duplicate data. To top it off, it probably fragments your filesystem. – jozxyqk Mar 23 '14 at 7:04
  • 1
    @jozxyqk: the OP wants to move from C: to F:. I don't know how to to that without transferring the data. – Stephan Mar 23 '14 at 7:14
  • 1
    @jozxyqk: Then move is the right way to do it for you. It only changes FAT-Entries without moving the files. (that's why it don't work from one drive to another) – Stephan Mar 23 '14 at 7:18
  • 1
    @Stephan That's exactly what I'm after but I'm having some issues replacing/merging when folder names match – jozxyqk Mar 23 '14 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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