Batch file activation code

September 29, 2011 at 14:19:26
Specs: Windows XP
Every school year, my friend and I make a new version of a batch file program as a hobby.
I wanted to make a new program that you had to get prior permissoin from to activate it.
After that, you ned to type in a serial number in order to make a new account.
I was using the %random% command, but Using letters would be nice. I would also like it to
make it so the code will update it every so often.
@echo off
color 0a
set /p c=enter code:
if %c%==342iohjtoi324hnt goto 1

echo activation complete!

then after that

@echo off
if %time%==12:30 set /p serial=1283yr5dfigi43750934u34jt904r

any way you could do that?
Any help appreciated.

See More: Batch file activation code

Report •

September 30, 2011 at 14:45:40
How about this. This will change the code to whatever you define past 12:00 PM (One code before 12, different after 12)

@echo off
For /F "tokens=1,2 delims=:,. " %%A in ('echo %time%') do set /a timecheck=%%A%%B
If %timecheck% LEQ 1200 (set code=password1) ELSE set code=password2
set /p codeprompt=Please enter the password:
if %codeprompt% EQU %code% (goto auth) ELSE goto fail

Echo Success

Echo Failure


This is of course all trivial as the passwords are clear text in your bat file :P

Report •
Related Solutions

Ask Question