Add in the batch file:
@echo off
choice /c:(password)/n
That's it! For example, if you write "choice /c:a/n", then when you run this batch file, you will be asked for the password. If you enter a, it will continue to run, otherwise you'll just wait!
Note that the password here can only be one digit. If you set 1234 as the password, then entering any of 1, 2, 3, or 4 is considered a correct password. How to improve the confidentiality of the password? You can use ASCII codes. For example, "space" is generated by pressing the number key 255 on the numeric keypad while holding down the ALT key.
Think about it, such a simple method can set a password for the operation of the batch file. Why not do it?!
@echo off
choice /c:(password)/n
That's it! For example, if you write "choice /c:a/n", then when you run this batch file, you will be asked for the password. If you enter a, it will continue to run, otherwise you'll just wait!
Note that the password here can only be one digit. If you set 1234 as the password, then entering any of 1, 2, 3, or 4 is considered a correct password. How to improve the confidentiality of the password? You can use ASCII codes. For example, "space" is generated by pressing the number key 255 on the numeric keypad while holding down the ALT key.
Think about it, such a simple method can set a password for the operation of the batch file. Why not do it?!
偶是新手,恳请各路大侠多多指正!



, is there any way to encrypt the batch file for unlocking. I personally think my purpose has been achieved, that is, adding a choice statement in the unlocking file, because after I lock the computer, I can't run word processing software.