?
Solved

Cannot MOVE directory to another drive from XP command line

Posted on 2004-04-05
10
Medium Priority
?
3,786 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 7

Accepted Solution

by:
4auHuk earned 300 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

765 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