1.

Solve : Hello - I would like some help.?

Answer»

It's with MS-Dos, duhh

Anyway my problem is, I want to create a "ONE command only" code.

A example of what I am doing:

Code: [Select]:G
color d
echo You have answered yes.

set /P user=Username:
set /p pass=Password:
set /p id=Activating ID:

if %id% == 9878498 GOTO X
cls
I want to make it so the %id% MUST be the exact code (9878498) else will it exit.
I do not KNOW how to make this, any help would be appreciated,

Regards - Dzenet.if not %Id%==Number exit

There you go. i recommend you to stop before you CONTINUE further. for the sake of security, don't ever do password authentication that way. unless this is just for fun. here are some approaches you can use, if not for fun
1) database approach. Set up a database, then have the user authenticate through it using 1 interface. practically, your application will be done not in batch, but with a proper language
2) use the active directory, if you have it.Hello,
Yes, it is a very poor idea to use batch file to gather password information.
The recommendation given above byghostdog74 is the right way to go. Inform your user that they have to login to a certain directory and they will be asked for a password. That should take care of most of the cases where you would need a password on a Windows desktop PC.



Discussion

No Comment Found