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/So开发者_如何学Pythonmething
And I want to move the files in " Something " to New folder.
Is there such a command?
Thanks a bunch :)
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.
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.
精彩评论