I am trying to make a file that asks for your username and password, with a registration. When registering, the passwords are saved in variables.
The problem is i have
You can use "delayed expansion" to solve the problem of the nested variables. For example, !%user1%pass!: the ! is like % but signals that expansion should be delayed, so %user1% will be expanded first, leaving you with !johnpass! which can be expanded next.
Here's a complete script:
@echo off
setlocal enabledelayedexpansion
set /p "user1=Username: "
set /p "%user1%pass=Password: "
echo %user1%'s password is !%user1%pass!