using the "move" command via command line

Hello there - first off thanks for taking a look and my problem.
The situation: I'm writing one line of code to move data from a to b and I'm getting an syntax incorrect error. There's a good reason for doing this via command but I won't bore you with the details:)

Code: move G:\uploads\* H:\old users\departed employee images\
Error: The syntax of the command is incorrect

The G: drive is a internal hard drive and the H: is an external drive attached to the same system. All necessary rights have been setup/verified on the traversed directories. Spelling and directory paths have been ruled out. I ran the same command on some test directories in the root of C:\ without any trouble.  

Any input is much appciated!
CG_HDAsked:
Who is Participating?
 
oBdACommented:
The internal move command will only work in the same partition, you can't move files or folders across partitions with it.
Either use robocopy from the W2k3 ResKit, which will (with the argument /mov) copy, then delete the source, or use two commands in your batch, one for the copy and one to delete the source:

copy  "G:\uploads\*" "H:\old users\departed employee images"
if not errorlevel 1 del /f /s /q "G:\uploads\*"

Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
USE QUOTES for paths with spaces and use the full wild card specification:
move "G:\uploads\*.*" "H:\old users\departed employee images\"
0
 
CG_HDAuthor Commented:
Using "G:\uploads\*.*" "H:\old users\departed employee images\" I get a slightly different error...

Error: The filename, directory name, or volume label syntax is incorrect.

The filename,  directory name and volume label  (G: and H:) have been verified.

thoughts?
0
 
CG_HDAuthor Commented:
Thanks oBdA - with a little tweeking that work perfectly...I appreciate everyone's help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.