I have a folder on my drive, which I regulary clean. It has only txt files with sql logs. How can I write batch script which is going to clean it when I run it ? What I mean is, I do not want to go to drive, look for the folder, etc. Just have a shortcut on my screen, which is going to turn batch script on.
I tried to write it myslef, and modify it a bit, but its not working.
`@echo off
set "search_folder=C:\path\to\folder"
for /f "delims=" %%f in ('dir /b /s /a-d "%search_folder%\*.txt"') do (
type "%%f" | findstr /v /r "^[ ]*$" > temp.txt
move /y temp.txt "%%f"
)`
it does not delete anything