Add A Password To A .Bat File
If you want to add password protection to a windows batch script, follow the simple steps below
Open notepad by going to Start> All Programs> Accessories> Notepad. Vista and 7 users can just type "notepad, without quotes, into the start menu and hit enter
Copy the following code:
- echo enter password to activate programme
- set/p "pass=>"
- if NOT%pass%== passwordhere goto:FAIL
At the end of your programme, you need to add:
- echo Invalid password
Change "passwordhere" to the password of your choice.
This is a very basic password code. Anyone with knowledge of .bat files will still be able to access it.