title: How to encrypt a string and save it in a file and read the decrypted string from the same file?
body: <p>I found an useful code on the net to encrypt and decrypt strings.
  So i wanted to change it a little , in order to let the encryption and decryption in the same batch and not into two separate files here is the link <a href="http://forum.imgburn.com/index.php?/topic/21566-batch-encryption-working/" rel="nofollow noreferrer">Batch Encryption</a></p>
  <p>And here is my modified code:</p>
  <pre><code>@echo off
  setlocal  ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  title Encrypt and decrypt string
  color a
  (set CHAR[a]=UDFM45) &amp; (set CHAR[b]=H21DGF) &amp; (set CHAR[c]=FDH56D) &amp; (set CHAR[d]=FGS546) &amp; (set CHAR[e]=JUK4JH)
  (set CHAR[f]=ERG54S) &amp; (set CHAR[g]=T5H4FD) &amp; (set CHAR[h]=RG641G) &amp; (set CHAR[i]=RG4F4D) &amp; (set CHAR[j]=RT56F6)
  (set CHAR[k]=VCBC3B) &amp; (set CHAR[l]=F8G9GF) &amp; (set CHAR[m]=FD4CJS) &amp; (set CHAR[n]=G423FG) &amp; (set CHAR[o]=F45GC2)
  (set CHAR[p]=TH5DF5) &amp; (set CHAR[q]=CV4F6R) &amp; (set CHAR[r]=XF64TS) &amp; (set CHAR[s]=X78DGT) &amp; (set CHAR[t]=TH74SJ)
  (set CHAR[u]=BCX6DF) &amp; (set CHAR[v]=FG65SD) &amp; (set CHAR[w]=4KL45D) &amp; (set CHAR[x]=GFH3F2) &amp; (set CHAR[y]=GH56GF)
  (set CHAR[z]=45T1FG) &amp; (set CHAR[1]=D4G23D) &amp; (set CHAR[2]=GB56FG) &amp; (set CHAR[3]=SF45GF) &amp; (set CHAR[4]=P4FF12)
  (set CHAR[5]=F6DFG1) &amp; (set CHAR[6]=56FG4G) &amp; (set CHAR[7]=USGFDG) &amp; (set CHAR[8]=FKHFDG) &amp; (set CHAR[9]=IFGJH6)
  (set CHAR[0]=87H8G7) &amp; (set CHAR[@]=G25GHF) &amp; (set CHAR[#]=45FGFH) &amp; (set CHAR[$]=75FG45) &amp; (set CHAR[*]=54GDH5)
  (set CHAR[(]=45F465) &amp; (set CHAR[.]=HG56FG) &amp; (set CHAR[,]=DF56H4) &amp; (set CHAR[-]=F5JHFH) &amp; (set CHAR[ ]=SGF4HF)
  (set CHAR[\]=45GH45) &amp; (set CHAR[/]=56H45G)
  echo Enter a string to encrypt:
  set /p Encrypt=
  cls
  set Encrypt2=%Encrypt%
  set &quot;EncryptOut=&quot;
  :encrypt2
  set char=%Encrypt2:~0,1%
  set Encrypt2=%Encrypt2:~1%
  set EncryptOut=%EncryptOut%!CHAR[%char%]!
  if not &quot;%Encrypt2%&quot;==&quot;&quot; goto encrypt2
  echo.%EncryptOut%&gt;%~dp0encrypted.txt
  echo.
  set /p CryptedPass=&lt;%~dp0encrypted.txt
  echo Input string clear text ===^&gt; %Encrypt%
  echo.
  echo Output string crypted ===^&gt; %CryptedPass%
  pause
  
  set /p Decrypt=&lt;%~dp0encrypted.txt
  cls
  set Decrypt2=%Decrypt%
  set &quot;DecryptOut=&quot;
  :decrypt2
  set char=%Decrypt2:~0,6%
  set Decrypt2=%Decrypt2:~6%
  set DecryptOut=%DecryptOut%!CHAR[%char%]!
  if not &quot;%Decrypt2%&quot;==&quot;&quot; goto decrypt2
  echo Input string: %Decrypt%
  echo.
  echo Output string: %DecryptOut%
  pause
  </code></pre>
  <p>my problem is in the last part of the code ie the display of the string to  read the decrypted string from the text file? he shows me nothing ?
  Surely I missed something? but I can't find it where exactly ?
  thank you in advance</p>