Instructables

how can i password protect a batch file but still be able to change the password without having to edit the code?


wizerd 7454 years ago
First, I would create a txt file sepporate from the batch and name it your password.Hide the txt somewhere. Then enter this at the top of the batch (replacing %location% with the location of the txt):
@echo off
set /p password=ENTER THE PASSWORD:
If exist %location%%password%.txt GoTo start
echo ACCESS DENIED
pause>null
exit
:start
::the rest of the batch goes here
_
Then you will want to convert this batch to a exe as anyone can simply click edit on the batch and find the password.
Have you tried this?
Scytheon3 (author)  wizerd 7454 years ago
I found a much better way now using .dat files in the windows 32 folder appdata
ok. :-) and thx for putting mine (not that anyone else answered) as best answer!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!