Solved

Cannot MOVE directory to another drive from XP command line

Posted on 2004-04-05
10
3,776 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 30

Expert Comment

by:SteveGTR
ID: 10763287
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
ID: 10763819
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
ID: 10765125
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
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 7

Accepted Solution

by:
4auHuk earned 100 total points
ID: 10765664
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
ID: 10766034
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
 
LVL 7

Expert Comment

by:4auHuk
ID: 10766760
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
ID: 10768268
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
ID: 10771224
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
ID: 10771868
No, no compression or encryption.
0
 
LVL 7

Expert Comment

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

761 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