Solved Batch for /L command help.

September 29, 2014 at 12:04:13
Specs: Windows 7, Intel(R) Core(TM) i3 / 3.20 GHz / 8 GB Ram
Hi, I was doing a bit of school work(with dices so it's not super important).
So I thought I would make a program to automate it.
But apparently I don't know how for /L works.


@echo off
for %%a IN (1,1,6) DO (
for %%b IN (1,1,6) DO (
for %%c IN (1,1,6) DO (
echo %%a %%b %%c
)
)
)
pause


This gave a result which I didn't expect at all.

1 1 1
1 1 1
1 1 6
1 1 1
1 1 1
1 1 6
1 6 1
1 6 1
1 6 6
1 1 1
1 1 1
1 1 6
1 1 1
1 1 1
1 1 6
1 6 1
1 6 1
1 6 6
6 1 1
6 1 1
6 1 6
6 1 1
6 1 1
6 1 6
6 6 1
6 6 1
6 6 6


Any help would be appreciated :)

message edited by SilasPc


See More: Batch for /L command help.

Report •

#1
September 29, 2014 at 13:23:44
✔ Best Answer
You forgot the '/L' in 'FOR /L'

How To Ask Questions The Smart Way


Report •

#2
September 29, 2014 at 23:38:11
Haha, lol. Well thanks anyways... Me in a nutshell 2.0. My day just became 30 times better haha :D

Report •
Related Solutions


Ask Question