Solved Alphabetical CMD file creator

Hewlett-packard Pavilion dv6-2190us note...
July 14, 2011 at 13:46:38
Specs: Win 7, Core i5 / 4 gigs
i'm creating a file namer in alphabetical order. here is the source code


echo off
cls
title Alpha_namer v 1.5.3

set w=0
set x=0
set y=0


:start
set v=0


:loop
echo off
set /a v=%v%+1
if %v%== 27 set/a w=%w%+1


if %v%== 1 set ltr1=a
if %v%== 2 set ltr1=b
if %v%== 3 set ltr1=c
if %v%== 4 set ltr1=d
if %v%== 5 set ltr1=e
if %v%== 6 set ltr1=f
if %v%== 7 set ltr1=g
if %v%== 8 set ltr1=h
if %v%== 9 set ltr1=i
if %v%== 10 set ltr1=j
if %v%== 11 set ltr1=k
if %v%== 12 set ltr1=l
if %v%== 13 set ltr1=m
if %v%== 14 set ltr1=n
if %v%== 15 set ltr1=o
if %v%== 16 set ltr1=p
if %v%== 17 set ltr1=q
if %v%== 18 set ltr1=r
if %v%== 19 set ltr1=s
if %v%== 20 set ltr1=t
if %v%== 21 set ltr1=u
if %v%== 22 set ltr1=v
if %v%== 23 set ltr1=w
if %v%== 24 set ltr1=x
if %v%== 25 set ltr1=y
if %v%== 26 set ltr1=z

if %v%== 27 goto start


if %w%== 1 set ltr2=a
if %w%== 2 set ltr2=b
if %w%== 3 set ltr2=c
if %w%== 4 set ltr2=d
if %w%== 5 set ltr2=e
if %w%== 6 set ltr2=f
if %w%== 7 set ltr2=g
if %w%== 8 set ltr2=h
if %w%== 9 set ltr2=i
if %w%== 10 set ltr2=j
if %w%== 11 set ltr2=k
if %w%== 12 set ltr2=l
if %w%== 13 set ltr2=m
if %w%== 14 set ltr2=n
if %w%== 15 set ltr2=o
if %w%== 16 set ltr2=p
if %w%== 17 set ltr2=q
if %w%== 18 set ltr2=r
if %w%== 19 set ltr2=s
if %w%== 20 set ltr2=t
if %w%== 21 set ltr2=u
if %w%== 22 set ltr2=v
if %w%== 23 set ltr2=w
if %w%== 24 set ltr2=x
if %w%== 25 set ltr2=y
if %w%== 26 set ltr2=z

if %w%== 27 set/a x=%x%+1

if %w%== 27 goto start

if %x%== 1 set ltr3=a
if %x%== 2 set ltr3=b
if %x%== 3 set ltr3=c
if %x%== 4 set ltr3=d
if %x%== 5 set ltr3=e
if %x%== 6 set ltr3=f
if %x%== 7 set ltr3=g
if %x%== 8 set ltr3=h
if %x%== 9 set ltr3=i
if %x%== 10 set ltr3=j
if %x%== 11 set ltr3=k
if %x%== 12 set ltr3=l
if %x%== 13 set ltr3=m
if %x%== 14 set ltr3=n
if %x%== 15 set ltr3=o
if %x%== 16 set ltr3=p
if %x%== 17 set ltr3=q
if %x%== 18 set ltr3=r
if %x%== 19 set ltr3=s
if %x%== 20 set ltr3=t
if %x%== 21 set ltr3=u
if %x%== 22 set ltr3=v
if %x%== 23 set ltr3=w
if %x%== 24 set ltr3=x
if %x%== 25 set ltr3=y
if %x%== 26 set ltr3=z

if %x%== 27 set/a y=%y%+1

if %x%== 27 goto start

if %y%== 1 set ltr4=a
if %y%== 2 set ltr4=b
if %y%== 3 set ltr4=c
if %y%== 4 set ltr4=d
if %y%== 5 set ltr4=e
if %y%== 6 set ltr4=f
if %y%== 7 set ltr4=g
if %y%== 8 set ltr4=h
if %y%== 9 set ltr4=i
if %y%== 10 set ltr4=j
if %y%== 11 set ltr4=k
if %y%== 12 set ltr4=l
if %y%== 13 set ltr4=m
if %y%== 14 set ltr4=n
if %y%== 15 set ltr4=o
if %y%== 16 set ltr4=p
if %y%== 17 set ltr4=q
if %y%== 18 set ltr4=r
if %y%== 19 set ltr4=s
if %y%== 20 set ltr4=t
if %y%== 21 set ltr4=u
if %y%== 22 set ltr4=v
if %y%== 23 set ltr4=w
if %y%== 24 set ltr4=x
if %y%== 25 set ltr4=y
if %y%== 26 set ltr4=z

if %y%== 27 set/a z=%z%+1

if %y%== 27 goto finish

echo %ltr4%%ltr3%%ltr2%%ltr1%
goto loop
:finish


i want it to have more letters.

aaaaaaaaaa.txt
aaaaaaaaab.txt
.
.
.
aaaaaaaacd.txt

you get the idea. it stops at zz for some reason. and it won't go any further


See More: Alphabetical CMD file creator

Report •


#1
July 15, 2011 at 14:40:12
✔ Best Answer
Hi
Are you trying to crash your machine with all those permutations.
This might give you some ideas 27,751 of them.

@echo off
SetLocal EnableDelayedExpansion
cls
set Str=abcdefghijklmnopqrstuvwxyz
set Num=0
for /L %%a in (0,1,25) do (
for /L %%b in (%%a,1,25) do (
for /L %%c in (%%b,1,25) do (
for /L %%d in (%%c,1,25) do (
set /a Num+=1
echo !Str:~%%a,1!!Str:~%%b,1!!Str:~%%c,1!!Str:~%%d,1! !Num!
rem pause >nul
)
)
)
)


Report •

#2
July 15, 2011 at 15:24:01
hmmm how do i get the numbers on the side to disappear?

and is there a way to get it too go

a
b
c
d
.
.
.
aa
ab
.
.
.
az
aaa
aab
.
.

according to this code... it doesn't look possible.
:P thanks for the help


Report •

#3
July 15, 2011 at 15:29:27
i love the fact that you replied to my post thank you for that.
but a slight bug i can't solve for is


abzz 676
accc 677

it doesn't recognize the letters corresponding before

abzz
acaa
acab
acac
acad

etc.


Report •

Related Solutions

#4
July 15, 2011 at 15:57:02
ok solved it :)

thanks for your help. figured out a legit that does what i want it to do@echo off
SetLocal EnableDelayedExpansion
cls
set Str=abcdefghijklmnopqrstuvwxyz
set Num=0
for /L %%a in (%%a,1,25) do (
for /L %%b in (%%b,1,25) do (
for /L %%c in (%%c,1,25) do (
for /L %%d in (%%d,1,25) do (
set /a Num+=1
echo !Str:~%%a,1!!Str:~%%b,1!!Str:~%%c,1!!Str:~%%d,1! !Num!
rem pause >nul
)
)
)
)


@echo off
SetLocal EnableDelayedExpansion
cls
set Str=abcdefghijklmnopqrstuvwxyz
set Num=0
for /L %%a in (%%a,1,25) do (
for /L %%b in (%%b,1,25) do (
for /L %%c in (%%c,1,25) do (
for /L %%d in (%%d,1,25) do (
set /a Num+=1
echo !Str:~%%a,1!!Str:~%%b,1!!Str:~%%c,1!!Str:~%%d,1! !Num!
rem pause >nul
)
)
)
)


Report •

Ask Question