Can someone tell me what the line command is so I can move multiple folders and files in another folder. Basicly tell it to move all folders and files inside a specific folder. Say I have a folder on my desktop named 1. Now I want all folders and files in that folder moved without having to list all of the folders because these folder names will change on a daily basis
If you do not specify a name how is the computer to know what to do? I do not believe you can move a folder and subfolders they way you would like to do it.
You could experiment using the xcopy command. That will copy a folder X with the subfolders. I have not written a batch file in many years I do not now if batch files/or the DOS window supports long file names. I also forget, you may be able to name the target or you can always rename the target folder maybe with a name passed to the batch file as a parameter. Then you would have to go into the folder X and delete *.*. That will accomplish the same thing. It is also safer if you trap write errors and exit out before the delete if an error occurs.
I can get it to copy folders and subfolders just fine. Just can't move the folders the way I want to. Oh well guess I'm screwed. Thanks for the responces
Originally posted by jerecho: I can get it to copy folders and subfolders just fine. Just can't move the folders the way I want to. Oh well guess I'm screwed. Thanks for the responces
So basically you're cutting and pasting instead of just copying?
Replace "copy" with "move".
Jerecho. If you want to move all files and sub-folders (at any level) from one folder to another folder, use the following commands in biterscripting. Here, the 'from' folder is C:/folder1, the 'to' folder is C:/folder2.
# Get a list of files and subfolders within C:/folder1.
var str list ; find -n "*" "C:/folder1" > $list
# Move each file and subfolder in the list to C:/folder2.
while ($list <> "")
do
var str item ; lex "1" $list > $item
system move $item "C:/folder2"
done
For automating things like this, especially when files/folders are created dynamically, and you don't know their names ahead of time, biterscripting turns out to be very helpful. Download it free at http://www.biterscripting.com/install.html . For example, if you want only to move files/folders created after Feb 3, 2009, add the following to the find command.