Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cannot MOVE directory to another drive from XP command line

Posted on 2004-04-05
10
Medium Priority
?
3,791 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

618 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