简体   繁体   中英

How to move all files excecpt one from parent folder into a new child folder using windows command?

How to move all files except one from the parent folder into a new child folder using the windows command?

I need to move all files except one file named index.html from the parent folder into a new child folder.

I have tried the below command but it is not working.

move parent_folder ./parent_folder/child_folder

Please refer below

Current Folder Structure

在此处输入图像描述

Required Folder Structure

在此处输入图像描述

在此处输入图像描述

I have achieved the above requirement using ' robocopy ' command.

Command

robocopy parent_folder parent_folder/child_folder/ *.* /E /XD child_folder /XF index.html /move

Referred URL - Windows batch command to move all folders in a directory with exceptions

Screenshot #1

在此处输入图像描述

Screenshot #2

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM