I need a batch file where a user enters a password and if it is correct it maps a drive. If it is wrong then it needs to go back to the start
I have this
:start
echo Username=****
SET /P password=Please enter the password
IF %password%==password goto map
IF %password%!==!password goto start
:map
NET USE Z: \\server\folder
It works if the password entered is correct, but doesnt if it is wrong
Any help?
You don’t need
IF %password%!==!password goto startaltogether. If the password is ok, thengoto map, otherwisegoto start. That is if you replaceIF %password%!==!password goto startwithgoto startyou’ll get what you want.