Password selects database

Jack
2012-11-18
2012-11-26
  • Jack

    Jack - 2012-11-18

    I've searched this forum regarding this topic and the only answer I've seen so far is to create two (or more) shortcuts, each with a different command line specifying which database to open. While this does solve the problem, it is much less elegant than having the master password select which database to open. Am I missing something or is this not possible yet in KeePass v1.x? I'm running Win XP.

    Tia,
    Jack

     
  • develop1

    develop1 - 2012-11-19

    not sure where you are going with the request or if any version of KP natively supports it.
    I suppose you could use notepad create a .vbs file  and then a create a short cut to run it.
    The vbs can ask for a master password.
    if the string you supply starts with the letter "a" the script tries to use that pasword to open  file "A" otherwise it tries to open file b if you enter no string at all then no file is attempted.
    this seems lame but I guess it gets you to what your asking for.

    strAnswer = InputBox("Please enter a master password",     "kdbx password")
    If strAnswer = "" Then
        Wscript.Quit
    End If
    if instr(strAnswer, "a") = 1 then
         strProg = """C:\Program Files\KeePass Password Safe 2\KeePass.exe"""  &  " ""C:\Documents and Settings\file_a.kdbx"" -pw:" & strAnswer
    else
         strProg = """C:\Program Files\KeePass Password Safe 2\KeePass.exe"""  &  " ""C:\Documents and Settings\file_b.kdbx"" -pw:" & strAnswer
    End If
    Wscript.Echo strProg
    set objShell = createobject("Wscript.Shell")
    objShell.Run strProg
    
     
    • Jack

      Jack - 2012-11-21

      Well, it may seem lame to you but it does EXACTLY what I wanted. With a few modifications to the file to match my environment, it executes perfectly. However, since I have absolutely no experience with vbs scripts (I had to Google VBS to find out what it was) and only a vague idea of what I'm doing, I am at a loss to understand why the dialog box titled "Windows Script Host" appears after entering the password and RETURN as it seems to serve no purpose. Regardless of whether I click OK or the RED X, whichever database matches the input password will still appear. Is that dialog box necessary or can it be eliminated and if so, how?

      Thank you very much for taking the time to compose that script. I really appreciate it.

      Jack

       
  • Paul

    Paul - 2012-11-21

    Remove this line
    Wscript.Echo strProg

    cheers, Paul

     
    • Jack

      Jack - 2012-11-21

      That did it! Thanks Paul and Develop1.

      Jack

       
  • Jack

    Jack - 2012-11-22

    So I put this modified script on my wife's laptop and when demonstrating it to her she asks "Why do the actual password characters appear when you're typing them in?" A question for which I had no answer. I wondered the same thing as I was tweaking it to get it to work on my desktop but wasn't really concerned about it. She of course, is. So... is there any way to get the script to disguise the characters with dots or something else to hide them from view?

    Again, TIA
    Jack

     
  • Jack

    Jack - 2012-11-25

    Wow. Bummer. I'm astounded that there's no way to do it from within VBS.

    Thanks for the help Paul but for me that's a little more learning (read: work) than I'm willing to undertake. Since neither of us accesses KeePass anywhere except from home, on our respective computers, it really shouldn't be a problem.

    Jack

     
  • Paul

    Paul - 2012-11-26

    You can use AutoIt. It's easier than VB and has a password mask option on the "inputbox" function.

    cheers, Paul

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks