Questions about command line copy/move functions

Arkitech

Diamond Member
Apr 13, 2000
8,356
4
76
I'm trying to write a simple script to move files (only) from various folders to a different location. I'm just unsure of how to do it recursively so that all subfolders are included in the move. I was looking into xcopy but didn't see which switch would apply. It seems that Robocopy might do the trick but again for some reason can't seem to find the right switch.


The other question I have involves copying 2 files from a network source to a local drive. The specific locations on the local drive would be the windows folder and the users/public/desktop folder. Would a simple command like the following suffice?

copy \\networksource\files\intranet.ico c:\windows
copy \\networksource\files\intranet.html c:\users\public\desktop



thanks for any suggestions
 

MerlinRML

Senior member
Sep 9, 2005
207
0
71
If you're actually trying to move an entire directory tree, you don't need to to move each folder recursively, you just move the top of the tree.

Code:
move c:\dir d:\
will move the dir directory and all contents (including subdirs )to the root of a different drive letter

If you're really trying to copy the files, then xcopy or robocopy will both work, just run the command with /? to see a list of arguments.