将文件夹移动到父目录

时间:2016-01-27 06:34:00

标签: file batch-file move

我一直在寻找合适的批处理文件命令,但仍无法找到任何解决方案。请帮帮我这个

我的usb驱动器(j :)在文件夹" inventory"中有一个名为" Inventory"的文件夹名称。有很多文件夹&带有空格的文件文件夹" Soda Coke" " soda pepsi"等文件和" soda coke.doc"," soda pepsi.doc"

我的问题是如何从"库存"移动所有文件?文件夹到我的usb根目录?

仅将j:\Inventory\"all files & folders"移至j:\,只有空格移至j:\并将所有文件移至//inflating row customView1=inflater.inflate(R.layout.single_row_materialdimension, null); container = (ViewGroup) findViewById(R.id.container); container.addView(customView1, 0, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); //Getting child Count from parent inflated the child int child = container.getChildCount(); container.setTag(child + 1); for (int i = 0; i < child; i++) { Log.e("ChildAt", "" + container.getChildAt(i)); View childView = container.getChildAt(i); Log.e("childView ", "childView" + childView); TextView tv1=(TextView)childView.findViewById(R.id.txt_parent_plus_id); // setting onClickListner to inflated child //i want to get unique id when i click on the inflated child** tv1.setOnClickListener(handleOnClick(tv1)); } //i want to get unique id when i click on the inflated child** View.OnClickListener handleOnClick(final View view) { return new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Log.e("Clicked", "Clicked" + container.getTag()); } }; } 后,&#34;清单&#34;文件夹将被删除

希望你能给我一个完美的批处理文件命令。

提前谢谢。

1 个答案:

答案 0 :(得分:0)

rem Moves your files
for /r "j:\Inventory\" %%x in (*.*) do move "%%x" "j:\"


Rem OR move files and folders with this
ROBOCOPY "j:\Inventory\" "j:\" /E /move

rem Delete folders
FOR /D %i IN (j:\Inventory\*) DO RD /S /Q "%i"
DEL /Q C:\mydir\*.*

我认为这是你正在寻找的命令。 :)