Skip to content

Instantly share code, notes, and snippets.

@adamfortuno
Last active October 17, 2019 14:21
Show Gist options
  • Save adamfortuno/da2f4cfe1a98495105a23a7afb1767ac to your computer and use it in GitHub Desktop.
Save adamfortuno/da2f4cfe1a98495105a23a7afb1767ac to your computer and use it in GitHub Desktop.
DOS script to Add the `dntz` File Extension to Any Files Without a File Extension
REM Will add the `dntz` file extension to files w/o a file extension
REM in the current directory
for %f IN ("*.") DO ren %f %f.dntz
REM Will add the `dntz` file extension to files w/o a file extension
REM in the current and any sub-directories
for /R %f IN ("*.") DO move %f %f.dntz
@adamfortuno
Copy link
Author

adamfortuno commented Oct 17, 2019

The first parameter for rename can be a relative or absolute file path. The second parameter has to be a filename and only the filename. If you need to recurse through a directory tree renaming as you go, use move instead of rename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment