Solved how to move file in batch NOT starting with specific letter

March 2, 2014 at 11:46:17
Specs: Windows 7
move "f"*.gif c:\win

The above command will move any .gif file that starts with an f to the win folder.

Is there a batch method to move any file that doesnt start with the letter "f" to another folder? Thanks.


See More: how to move file in batch NOT starting with specific letter

Report •

#1
March 2, 2014 at 13:42:27

Report •

#2
March 2, 2014 at 14:02:25
✔ Best Answer
If robocopy is not your thing and you want to do it the long way, move all the files you don't want copied first, then move the rest.

move "f"*.gif c:\ffiles
move *.gif c:\win
move c:\ffiles\*.gif c:\currentdirectory

I would test it, cause I'm on my windows phone...

::mike


Report •

#3
March 3, 2014 at 05:37:25
@echo off & setlocal EnableDelayedExpansion
for %%i in (*.gif) do (
  set name=%%~ni
  if not "!name:~0,1!"=="f" move "%%i"  "My_Folder"
)


Report •

Related Solutions

#4
April 22, 2014 at 18:06:57
What a great method.It works like a charm. Thank you.

Report •

Ask Question