You are not logged in.
hello
I want to create a different file in the folder with the function for, i've tried :
for /l %a in (1,1,10) do fsutil file createnew %random%.bat
but instead i get this :
Offline
The issue can be worked around several ways.
It occurs because %random% is parsed only when the loop is started - so it remains fixed at one value within the loop.
In the way you are using it this will work, but it can still fail on a file because the %random% variable can duplicate the same value in any given series of numbers.
@echo off
for /L %%a in (1,1,10) do call fsutil file createnew %%random%%.bat 100
pause
Last edited by foxidrive (13 Apr 2014 14:51)
Offline
The issue can be worked around several ways.
It occurs because %random% is parsed only when the loop is started - so it remains fixed at one value within the loop.In the way you are using it this will work, but it can still fail on a file because the %random% variable can duplicate the same value in any given series of numbers.
@echo off for /L %%a in (1,1,10) do call fsutil file createnew %%random%%.bat 100 pause
wow, it work
by the way, Can I write the code directly from cmd ?
thanks before
Offline