So, I'm trying to create a batch script that creates a number of files. Number of files to be created is supposed to be specified by user in the first argument as well as the extension for those files in the second argument. Here is the code I got:
@echo on
for /L %%x in (0,1,%1%) do (
type nul > x%random%.%2%
echo %1%
echo %%x
)
it looks like the loop runs %1 times, however the the random command only works when the loop runs for the first time and never gets updated. Therefore, only one file is created instead of the specified number. Please help me find my mistake, thank you!