Lock Notepad

Thread Starter

Anthony Quah

Joined Dec 1, 2007
80
hi all,

i kinda new to programming, i am trying to use program to lock my notepad so only i can have the access to the notepad. Have anyone got an ideal or programming that i can use on it? I have surf the net for the source code only find out this set of instruction which is in .bat format. The .bat format is just another program instruct to open the file if password is correct BUT my problem is I want to put password on that particular notepad and use password to open the same notepad NOT redirect me to the notepad. Need help on this..really appreciate it..


::START
@echo off
cls
: password
set input =
set /p input = password
:
if %input% == ( my password ) goto YES
if not %input% == (my password) go to NO

:YES
start (your program address etc MS Paint.exe)

:NO
echo incorrect password
goto password

::END
:: Save as xxxx.bat

Rgds,
Anthony
 

beenthere

Joined Apr 20, 2004
15,819
Back to the future - that looks like an old MSDOS batch file.

If you want to be the only user, then some sort of key switch for power may be the way to go.
 

kammenos

Joined Aug 3, 2008
127
You can encrypt the file notepad.exe. That would be a way. There are several encryption engines.

Your batch is rather old-fashioned and completely hackable (as someone can edit and see the password).

But why notepad? I mean, no matter what you do with notepad, people will always be able to see your text files, one way or another.

A simple way to hide your text files (and not your notepad) is to make a folder and give access only to administrators. Then give a password to your administrator accound

You can also encrypt your text files.

Now that i am thinking of it, why do you want to do this? ???
 

Thread Starter

Anthony Quah

Joined Dec 1, 2007
80
lol..it is just that i have a program which can read notepad and word only...it cannot read using MS Word. So i have to have my program in notepad ..so my program can execute it and run it....

i know it is hackable but i have no choice since it only read notepad and word..the best i can do is insert the above source code to lock it...

I need some suggestion how to lock the notepad itself without using .bat which only link the program with the path.
 

kammenos

Joined Aug 3, 2008
127
You can encrypt notepad. Google for a freeware encryption program. But you will have to decrypt notepad everytime to use it.

But one point: What if the "other" person get a copy of notepad. He/she will be able to run it
And another point: Even from command prompt you can give command "type <filename>" and see the file.

You should consider something else. Maybe not encrypting the notepad itself but encrypting the data you want to hide. What kind of data is that?
 

Thread Starter

Anthony Quah

Joined Dec 1, 2007
80
actually the data is a program ..i just dont want ppl to other my program in public computer...which i have to use sometimes to lock it...
 

kammenos

Joined Aug 3, 2008
127
Ok then, move this program into a folder with access only from a specified user account (that's easy to do with windows). Login using this account to run the program.
-OR-
Encrypt the program itsefl...
 

Thread Starter

Anthony Quah

Joined Dec 1, 2007
80
well...i am using my lab computer..i dont think they install MS Word on it...that why i try to use notepad..btw how you encrypt the program..any website i can use?
 

Thread Starter

Anthony Quah

Joined Dec 1, 2007
80
I would prefer using a source code myself to put in my notepad so it can lock...btw i am in lab so install a program would be invalid...anyway thank for the help
 
Top