Problem when creating batch file with batch file
Posted: 21 Jun 2014 09:48
Hi! In this piece of code, I'm trying to get the program to create an entirely new program, using the >> to put lines of code into a separate file. I've escaped all of the characters I thought necessary, but if you check it out yourself, the second half of the new code appears very messy. Could any of you help and tell me what's wrong?
Much appreciated!
Much appreciated!
Code: Select all
@echo off
title The Vault
color 0d
::initialization
if not exist "lckr0" md "lckr0"
if not exist "lckr0\passref.bat" goto :passref_creation
pause
:passref_creation
(
echo @echo off
echo setlocal EnableDelayedExpansion
echo title Enter Password...
echo color 0b
echo mode con: cols=50 lines=5
echo set "chars= abcdefghijklmnopqrstuvwxyz1234567890"
echo set "password="
echo set "asterix="
echo.
echo :main
echo cls
echo echo Password: ^%password^%
echo choice /c ^%chars: =^% /n /m "Password: ^%asterix^%"
echo set password=^%password^%^!chars:~^%errorlevel^%,1^!
echo set asterix=^%asterix^%*
echo goto :main
) >> "lckr0\passref.bat"