Search code examples
windowsbatch-filemove

Move everything on desktop except a specific folder using Windows batch script


I want to move all files and folders on my desktop (except the Recycle Bin an My Computer Icon) to another folder on my desktop. I tried to use the following Batch script to accomplish this.

move "C:\Users\Public\Desktop\*.*" "C:\Users\Public\Desktop\Dump\"

Unfortunately, it did not move anything at all. I am new to Batch script so any help would be appreciated.

The Dump folder is already created on the desktop. Could anyone please tell me how to move all other content on the desktop (Except the Recycle Bin and My Computer Icon) inside this folder using a Batch script?

I saved the file as move_files.bat on a different location and ran it by double clicking.


Solution

  • There is the local user desktop and then there is the public desktop. Likely what did not move is on the local user desktop which is a different path. Have you tried move %userprofile%\Desktop\*.* "C:\Users\Public\Desktop\Dump\"