views:

193

answers:

2

Hello People,

I want to create a batch file that moves all the files in this directory to its father directory. Like for example if I have a directory " Something " that contains files :

...New Folder/Something

And I want to move the files in " Something " to New folder.

Is there such a command?

Thanks a bunch :)

+2  A: 

Presuming you're talking about Windows batch files, move *.* ..\ should do the trick.

Edit: For example, if you opened cmd, you could input:

cd C:\New Folder\Something
move *.* ..\

which would move all files in C:\New Folder\Something into its 'father' directory.

Saul Rennison
Can you please elaborate more on that?Thank you very much :)
Mohammad
I've edited the answer to answer your comment.
Saul Rennison
A: 

It is possible only if you don't have subdirectories, because move doesn't walk the subdirectories. You can use xcopy with /E, however it will not delete the copied files and directories. Then you should use del ., but to delete the subdirectories you should call rd for each one, and that is not possible in batch files.

Lorenzo