So I was wondering how you could create a simple login box with vb and set it to log off the computer if the wrong password was entered three times.
I want to lock my batch file with it and instead of just closing the batch file after three failed attempts I also want it to log the user off of the computer as well. I already have the log off the pc script. This is what I have so far.
(Double click batch file which starts vbs file that says (assuming you've already tried to log in three times):
msgbox "You have exceeded your max login attempts." Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "C:\windows\system32\shutdown.exe /l /f", 0, false
and if you log in successfully then the batch continues on to do follow the given instructions...
@Echo Off Color 8F Title Record Systems :VarList REM ASSIGNING VALUES TO VARIABLES SET AdminPass=(****************) CLS REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM SESSION LOGIN BELOW REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ :LOGIN START LOGIN.vbs REM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM END SESSION LOGIN REM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM Main Menu BELOW :MainMenu CLS Type MainMenu.txt set /p Key= if %Key%==1 goto :WorkOrder if %Key%==2 goto :Receipts if %Key%==3 goto :Misc if %Key%==4 goto :LogOut
I just want to lock this batch file using a vb login screen that will log the user out of their pc if they enter the password wrong three times.
I don't have a server or anything. It'd have to be something like setting a variable to be the password and then comparing it with the entered text.
Thanks in advance,