2023年2月6日 星期一

Chat-GPT

Chat-GPT

Chat-GPT


Q: 
windows batch file to create 10 files which contant count of file and file name end with 001 until 010

A:


@echo off
setlocal enabledelayedexpansion
for /l %%i in (1,1,10) do (
    set "count=00%%i"
    set fileName=file_!count:~-3!.txt
    echo File number !count!: !fileName! > !fileName!
)
endlocal
pause


沒有留言: