Nf.zip -

:: This zips every .txt file in the folder into its own .zip file using 7-Zip FOR %%f IN (*.txt) DO 7z a "%%~nf.zip" "%%f" Use code with caution. Copied to clipboard %%f : The full filename (e.g., report.txt ). %%~nf : The name only (e.g., report ). %%~nf.zip : The resulting archive name (e.g., report.zip ). Other Interpretations Outside of technical scripting, "NF" may refer to: Create individual Zip files with a command line

This syntax is frequently used with tools like or WinZip to batch-process large groups of files. NF.zip

To use this in a ( .bat ), the variable must use double percent signs: :: This zips every

: 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 . NF.zip