Saturday, May 30, 2026

Create Multiple files using BAT command

You can Create 1oo Text files with file extension js, each filename begins with exercise word followed by a nuber, using following BAT command:
@echo off
    FOR /L %%i IN (1,1,99) DO (
        echo This is loop iteration %%i
         type nul > exercise%%i.js
    )
    pause
The following BAT command creates a blank text file named exercise.txt:
@echo off
type nul > exercise.txt

No comments:

Post a Comment

Hot Topics