How to Add a Password to a .Bat File
Have you ever wanted to add password protection to a windows batch script? Read on to find out how.
Steps
-
1Open 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 enterAd
-
2Copy the following code:Ad
:A echo enter password to activate programme set/p "pass=>" if NOT %pass%== passwordhere goto :FAIL
-
1At the end of your program, you need to add:Ad
:FAIL echo Invalid password goto :end :end
We could really use your help!
money and finance?

sexual health?

microwaved corn?

trapping large animals?

Tips
- Change "passwordhere" to the password of your choice.
- If you are not sure how to create good .bat files see some of my other articles to find out how to make some .bat programmes
Warnings
- This is a very basic password code. Anyone with knowledge of .bat files will still be able to access it.
Article Info
Categories: Hacks | Windows Passwords
In other languages:
Español: Cómo establecer una contraseña en un archivo .bat, Русский: установить пароль на BAT файл, Português: Como Adicionar uma Senha a um Arquivo .Bat
Thanks to all authors for creating a page that has been read 38,188 times.
About this wikiHow