Lock Notepad

Discussion in 'Programmer's Corner' started by Anthony Quah, Aug 21, 2008.

  1. Anthony Quah

    Thread Starter Active Member

    Dec 1, 2007
    80
    0
    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
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  3. kammenos

    Active Member

    Aug 3, 2008
    127
    0
    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? ???
     
  4. Anthony Quah

    Thread Starter Active Member

    Dec 1, 2007
    80
    0
    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.
     
  5. kammenos

    Active Member

    Aug 3, 2008
    127
    0
    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?
     
  6. Anthony Quah

    Thread Starter Active Member

    Dec 1, 2007
    80
    0
    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...
     
  7. kammenos

    Active Member

    Aug 3, 2008
    127
    0
    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...
     
  8. Anthony Quah

    Thread Starter Active Member

    Dec 1, 2007
    80
    0
    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?
     
  9. kammenos

    Active Member

    Aug 3, 2008
    127
    0
  10. Anthony Quah

    Thread Starter Active Member

    Dec 1, 2007
    80
    0
    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
     
Loading...