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.
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
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
strProg = """C:\Program Files\KeePass Password Safe 2\KeePass.exe""" & " ""C:\Documents and Settings\file_b.kdbx"" -pw:" & strAnswer
set objShell = createobject("Wscript.Shell")
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.
Remove this line
That did it! Thanks Paul and Develop1.
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?
There is no easy way, but this page has something for you to try.
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.
You can use AutoIt. It's easier than VB and has a password mask option on the "inputbox" function.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.