Once I realised what "var" was, I got thinking and I was able to make the program take one input and code and decode it. I also tried something that compacts the hole thing into one file. I copied the contents of a.txt into the batch file and told it to look at itself for the key.
@echo off
setlocal enabledelayedexpansion
set /p encode=WORD:
set num=0
:LOOPE
call set tmpa=%%encode:~%num%,1%%%
set /a num+=1
for /f "tokens=1,2 delims==" %%a in (coder.bat) do (
if "%tmpa%" equ "%%a" set enword=%enword%%%b
)
echo %enword%> code.txt
if not "%tmpa%" equ "" goto LOOPE
echo ENCODE: %enword%
set num=0
:LOOPD
call set tmpa=%%encode:~%num%,2%%%
set /a num+=2
for /f "tokens=1,2 delims==" %%a in (coder.bat) do (
if "%tmpa%" equ "%%b" set deword=%deword%%%a
)
if not "%tmpa%" equ "" goto LOOPD
echo DECODE: %deword%
pause
a=87
b=63
c=60
d=52
e=76
f=39
g=49
h=38
i=31
j=93
k=09
l=82
m=72
n=69
o=13
p=74
q=85
r=10
s=41
t=26
u=61
v=07
w=56
x=32
y=12
z=19
=05
.=30
?=90
,=80
@=36
#=03
$=40
%=08
_=70
+=01
*=06
-=20
/=//
'=''
:=::
"=""
[=[[
]=]]
\=\\
}=}}
{={{
1=55
2=11
3=88
4=77
5=00
6=99
7=22
8=77
9=66
0=44
My file is called "coder.bat" and the output file is "code.txt". The only weird thing is that it says "pause" after the decode text. This is what you see.
WORD:i like pie. <<<Your input
ENCODE: 3105823109760574317630 <<<Code automaticly copyed to code.txt
DECODE: goto START <<<Weard
Press any key to continue . . .
WORD:3105823109760574317630 <<<Code you paste in
ENCODE: 88554400771188554466229944002277885522998844 <<<What I call super coded
DECODE: i like pie.goto START <<<The decoded text+pause
Press any key to continue . . .