Solved

Cannot MOVE directory to another drive from XP command line

Posted on 2004-04-05
10
3,768 Views
Last Modified: 2008-10-13
I cannot use the 'move' command to move a directory from one drive to another from the Windows XP command prompt.

eg:   move c:\any_folder D:

results in the error message: "Access is denied." If copying to the same drive letter, it works fine. Is there a solution or workaround (eg: using xcopy and rmdir?). I want to copy all files and subdirs. I prefer using a simple command like 'move' because of it is safer than copying and deleting files.
0
Comment
Question by:elzmaddy
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
I tried it on my XP machine and had the same results. You could use the Windows Explorer to cut and paste the directory from one drive to another.

An automated approach could use xcopy and rmdir:

xcopy /i c:\any_folder d:\any_folder
rd c:\any_folder /s /q

Good Luck,
Steve
0
 

Author Comment

by:elzmaddy
Comment Utility
It seems to work rather well. I use these commands for my particular application (in a batch file):

xcopy /I /S /V /F /H /-Y  c:\source d:\destination
rd c:\source /s /q

However, it is much slower than the 'move' command when copying to the same drive because data is written over. I believe all the move command does is change an entry in the file system table. That would explain why it cannot move to another disk.

But it works great. Thanks Steve.
0
 
LVL 8

Expert Comment

by:K_2K
Comment Utility
Even in Explorer cut and paste becomes a copy instead of move when used across drives.  M¢ did this on purpose to protect us from ourselves, guessing that we don't know the difference between move and copy but would never really want to take a file off a device.  

Bill must have stock in several hard drive manufacturing companies.

I'd stick to Steve's answer.
0
 
LVL 7

Accepted Solution

by:
4auHuk earned 100 total points
Comment Utility
Moving files/folders between volumes is always sum of copy+delete. How can it be done otherwise?

Still it is silly behaviour for "move" to produce "Access denied" error. It seems that "move" really just tries to relink folder in fs table.

elzmaddy,
If speed is your concern you can check if source and destination are on the same volume or not and choose appropriate command ("move" or "xcopy+rd") within your batch.

4auHuk
0
 
LVL 8

Expert Comment

by:K_2K
Comment Utility
True, at the core move actually leaves files in place and changes the directories to reflect which one has it, far more kin to rename and removed from copy.

But when i drag a file off my thumb drive into "My Documents" and I choose not to hold down the Ctrl key for copy, Windows should be smart enough to know i do NOT want that thing still cluttering up my pocket.  It should do the copy, verify, and remove with no questions asked.  It does not do that and IMHO never will do as it should.  M¢ will never completely understand why we laugh and scoff at the "Press Any Key To Continue" prompt.


While we're ranting about random M¢ wrongness:
Who can we tell that while "My Documents" was wrong but marginally accepted, “My Music" and "My Pictures" and all the rest are TOTALLY unacceptable?
Under NT and 98, WinLogo+E opened Explorer (XP still does)
                          N jumped to "Network Neighborhood"  (not anymore)
                          RightArrow opened the list                  (not there yet)
                          First letter of the share name i wanted took me there.
                          4 keys, blindfolded, i got what i wanted
NOW i gotta lean on the M key for "My this" and "My that" and I can't just count em because the next "Something" that comes along will be jammed in there as "My Something"
They should not be forcing me to look at my screen or worse - use a mouse.
Yes, I can change each name, but that too should not be "My Job".


(\o/)  'nuff sed,
2K
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:4auHuk
Comment Utility
Agree about drag and drop, but taking in account you do not like mouse, why not just Ctrl+X(C) --> Alt+Tab (or whatever) --> Ctrl+V? :)
As for navigation, well, what I usually do is Win+R \\server\share <Enter>. Moreover \\s will show all variants in drop-down menu as well as \\server\s

"My this", "My that" - all this is a part of "Desktop" metaphor that Explorer shell GUI uses. Obviously it is optimised for mouse, not for keyboard shortcuts.


P.S. "No keyboard found. Press any key to continue or DEL to Setup" <-- that's my favorite joke of the whole PC era :)

P.P.S. Sorry for offtopic every1
0
 

Author Comment

by:elzmaddy
Comment Utility
4aHuk: Your suggestion is probably the most efficient, although slightly more difficult to code. I should have mentioned that this process must be done at the command prompt (not Explorer), because my console-based application will figure out what folders to move, then it shells to the system and executes the commad.

I will probably stick to the simplest solution for now.

As for Explorer, I noticed sometimes when I cut and paste some files or folders to another location on the same disk partition, the process is instantaneous (just a relink). Other times, there is a progress bar and heavy disk access. I don't understand why.
0
 
LVL 8

Expert Comment

by:K_2K
Comment Utility
Is some of your partition using NTFS compression, and some of it not?

Are the areas that take more time using a different password for encrypting the files?  (none counts as different from any)
0
 

Author Comment

by:elzmaddy
Comment Utility
No, no compression or encryption.
0
 
LVL 7

Expert Comment

by:4auHuk
Comment Utility
Hmm...
elzmaddy, i believe you should give credit to Steve
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now