WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Password Tips

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Ask for a Password Upon Startup

Keywords: 	 startup password

Question:

I'm trying to write a script that will ask for a password upon startup. I'm using WIN95. Here is what I have so far:
	pw = askpassword("security check", "enter your password")

	if pw == "123"
	exit

	else
	message("invalid password", "this is your last chance")

	endif
I would like it to keep looping through this until they enter a password, and don't want them to be able to just click cancel and bypass it. Basically, I want to give them two strikes then they're out. I could either just have it keep prompting them or shutdown the machine after 3 unsuccessful logins.

Is there an internal control that will restart the 32-bit machines??

Oh and how would I prevent them from going into other apps in the start menu or on the desktop?

Answer:

Try this. Please note that the security is not real good, because the user can Ctrl-Alt-Delete and cancel the script.

What are you up to? Maybe for Windows 95 you might want "kiosk mode" (Some IntControl roundabout 60 or so).

;Assuming WinBatch 98B
IntControl(12,9,0,0,0)
BoxOpen("Password Check","Waiting for password")
WinZoom("Password Check")
IntControl(54,"Password Check",1,0,0)

count=0
while 1
   :CANCEL
   xxx=AskPassword("Eeep","Enter Password")
   if xxx=="123"
      exit
   endif
   Display(5,"Ooop","Invalid Password")
   count=count+1
   if count==5
      IntControl(67,0,0,0,0)
   endif
endwhile
exit

Article ID:   W13301
Filename:   Ask for a Password Upon Startup.txt
File Created: 1999:04:15:16:53:06
Last Updated: 1999:04:15:16:53:06