Deleting files named "._*"
Posted: 01 Dec 2017 14:08
Hello everyone! I am trying to delete all files in a certain directory and its sub-directories that has the name "._*" but this is the code I have but it is giving me an error.
Error Message:
This batch file is located in "H:\directory" and some example file names include:
Code: Select all
@echo off
setlocal
set count=0
set pattern=._*
for /f %%i in ('dir /b /a-d %pattern% ^| find /c /v ""') do @call set count=%%i
del /s /q /f ._*.txt
echo %count% files deleted
endlocal
Code: Select all
Could Not Find H:\directory\._*
Code: Select all
._random.txt
._Day 1.docx
._Screen Shot 2017-05-26 at 2.16.41 PM.png
._Workbook1.xlsx
._Zoomin.mov
._Zoomout.mov