This syntax is frequently used with tools like or WinZip to batch-process large groups of files.
To use this in a ( .bat ), the variable must use double percent signs: NF.zip
: When combined with a /R flag, it allows a script to dive into subfolders, find specific file types, and zip them individually while preserving the original file names. Example Script Syntax This syntax is frequently used with tools like
: If you have a folder full of text files ( file1.txt , file2.txt ), a batch script using %~nf.zip will create file1.zip and file2.zip rather than file1.txt.zip . find specific file types