How to Add a Password to a .Bat File

Posted by taoufiq  |  at  11:33 AM No comments

Have you ever wanted to add password protection to a windows batch script? Read on to find out how


Steps

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:
  •  :A
  • 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:
  • :FAIL
  • echo Invalid password
  • goto :end
  •  :end

This is a very basic password code. Anyone with knowledge of .bat files will still be able to access it.

Tags:
About the Author

Write admin description here..

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

Related posts

0 comments:

© 2013 FreshGeek. WP Theme-junkie converted by BloggerTheme9
Blogger templates. Proudly Powered by Blogger.
back to top