Skip to content

Instantly share code, notes, and snippets.

@xv
Created May 18, 2019 18:56
Show Gist options
  • Save xv/ddcaa91962a5ba2d01e49be88f6ba0f9 to your computer and use it in GitHub Desktop.
Save xv/ddcaa91962a5ba2d01e49be88f6ba0f9 to your computer and use it in GitHub Desktop.
Iterates through files of a matching extension and deletes their content while keeping the files themselves.
@echo off
rem change .txt to whatever extension you want
type nul > content
for %%f in (*.txt) do copy /y content %%f
del content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment