Can I configure KeePass to prompt for master key/password on Windows restore?












10















I have configured KeePass to Lock workspace when computer is about to be suspended (under Options→Security), which ensures my passwords are protected when my Windows 7 system sleeps or hibernates. But each time I restore my system from sleep or hibernation, my passwords are consequently locked and I must right-click KeePass' tray icon, select Unlock Workspace, and enter my database master key.



Is there a way to have KeePass prompt for my key automatically in this situation?










share|improve this question



























    10















    I have configured KeePass to Lock workspace when computer is about to be suspended (under Options→Security), which ensures my passwords are protected when my Windows 7 system sleeps or hibernates. But each time I restore my system from sleep or hibernation, my passwords are consequently locked and I must right-click KeePass' tray icon, select Unlock Workspace, and enter my database master key.



    Is there a way to have KeePass prompt for my key automatically in this situation?










    share|improve this question

























      10












      10








      10








      I have configured KeePass to Lock workspace when computer is about to be suspended (under Options→Security), which ensures my passwords are protected when my Windows 7 system sleeps or hibernates. But each time I restore my system from sleep or hibernation, my passwords are consequently locked and I must right-click KeePass' tray icon, select Unlock Workspace, and enter my database master key.



      Is there a way to have KeePass prompt for my key automatically in this situation?










      share|improve this question














      I have configured KeePass to Lock workspace when computer is about to be suspended (under Options→Security), which ensures my passwords are protected when my Windows 7 system sleeps or hibernates. But each time I restore my system from sleep or hibernation, my passwords are consequently locked and I must right-click KeePass' tray icon, select Unlock Workspace, and enter my database master key.



      Is there a way to have KeePass prompt for my key automatically in this situation?







      windows automation keepass






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 11 at 17:06









      CODE-REaDCODE-REaD

      323111




      323111






















          1 Answer
          1






          active

          oldest

          votes


















          14














          (I answer my own question):



          I can find no way to configure KeePass itself to Prompt for master password when restored, so here is a workaround based on this superuser question:



          Create and save a new Windows Scheduled Task:




          1. Start Task Scheduler: WinAdministrative
            Tools→Task Scheduler
            , or Win+R and enter
            taskschd.msc

          2. In Task Scheduler, Action→Create Task

          3. In Create Task's General tab, name the task Run KeePass at unlock

          4. In Create Task's Triggers tab, click New... then for Begin the task: select On
            workstation unlock
            and click OK

          5. In Create Task's Actions tab, click New... then in the Program/script field enter "C:WINDOWSSystem32cmd.exe" and in the Add arguments (optional) field enter /c start "" <location of your KeePass database file> (the location of your KeePass database file appears in KeePass' main window title).

          6. Click OK in Create Task to save the task, then close the Task Scheduler window.


          Now when you unlock your system, Task Scheduler will execute KeePass, which will gain focus and prompt you for your Master Password. If you have KeePass configured to Minimize main window after opening a database (under Options→Interface), your KeePass windows will also minimize after you have successfully entered your Master Password.






          share|improve this answer





















          • 3





            Out of curiosity, is there a reason why you can't enter the path to KeePass in the Program/script field directly, instead of as an argument to cmd.exe?

            – Kodos Johnson
            Jan 12 at 1:59













          • @KodosJohnson, initially I entered the path as you describe. That caused KeePass to prompt me when I restored my Windows, but KeePass' prompt did not have focus, so I needed to click on the Master Password input field before typing. The use of cmd.exe eliminates this need.

            – CODE-REaD
            Jan 12 at 16:35











          • Perhaps this could be of use to you: stackoverflow.com/questions/35988863/…. Also, maybe you need to add a delay somehow in the scheduled task.

            – Kodos Johnson
            Jan 18 at 17:07











          • @KodosJohnson, thank you. I considered sendKeys.bat but want to keep this solution as simple as possible. The latest revision (pointing start to the location of my KeePass database) seems to work reliably so I've updated my answer with it. Please let me know if there are any problems with this approach.

            – CODE-REaD
            Jan 19 at 14:44











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1393243%2fcan-i-configure-keepass-to-prompt-for-master-key-password-on-windows-restore%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          14














          (I answer my own question):



          I can find no way to configure KeePass itself to Prompt for master password when restored, so here is a workaround based on this superuser question:



          Create and save a new Windows Scheduled Task:




          1. Start Task Scheduler: WinAdministrative
            Tools→Task Scheduler
            , or Win+R and enter
            taskschd.msc

          2. In Task Scheduler, Action→Create Task

          3. In Create Task's General tab, name the task Run KeePass at unlock

          4. In Create Task's Triggers tab, click New... then for Begin the task: select On
            workstation unlock
            and click OK

          5. In Create Task's Actions tab, click New... then in the Program/script field enter "C:WINDOWSSystem32cmd.exe" and in the Add arguments (optional) field enter /c start "" <location of your KeePass database file> (the location of your KeePass database file appears in KeePass' main window title).

          6. Click OK in Create Task to save the task, then close the Task Scheduler window.


          Now when you unlock your system, Task Scheduler will execute KeePass, which will gain focus and prompt you for your Master Password. If you have KeePass configured to Minimize main window after opening a database (under Options→Interface), your KeePass windows will also minimize after you have successfully entered your Master Password.






          share|improve this answer





















          • 3





            Out of curiosity, is there a reason why you can't enter the path to KeePass in the Program/script field directly, instead of as an argument to cmd.exe?

            – Kodos Johnson
            Jan 12 at 1:59













          • @KodosJohnson, initially I entered the path as you describe. That caused KeePass to prompt me when I restored my Windows, but KeePass' prompt did not have focus, so I needed to click on the Master Password input field before typing. The use of cmd.exe eliminates this need.

            – CODE-REaD
            Jan 12 at 16:35











          • Perhaps this could be of use to you: stackoverflow.com/questions/35988863/…. Also, maybe you need to add a delay somehow in the scheduled task.

            – Kodos Johnson
            Jan 18 at 17:07











          • @KodosJohnson, thank you. I considered sendKeys.bat but want to keep this solution as simple as possible. The latest revision (pointing start to the location of my KeePass database) seems to work reliably so I've updated my answer with it. Please let me know if there are any problems with this approach.

            – CODE-REaD
            Jan 19 at 14:44
















          14














          (I answer my own question):



          I can find no way to configure KeePass itself to Prompt for master password when restored, so here is a workaround based on this superuser question:



          Create and save a new Windows Scheduled Task:




          1. Start Task Scheduler: WinAdministrative
            Tools→Task Scheduler
            , or Win+R and enter
            taskschd.msc

          2. In Task Scheduler, Action→Create Task

          3. In Create Task's General tab, name the task Run KeePass at unlock

          4. In Create Task's Triggers tab, click New... then for Begin the task: select On
            workstation unlock
            and click OK

          5. In Create Task's Actions tab, click New... then in the Program/script field enter "C:WINDOWSSystem32cmd.exe" and in the Add arguments (optional) field enter /c start "" <location of your KeePass database file> (the location of your KeePass database file appears in KeePass' main window title).

          6. Click OK in Create Task to save the task, then close the Task Scheduler window.


          Now when you unlock your system, Task Scheduler will execute KeePass, which will gain focus and prompt you for your Master Password. If you have KeePass configured to Minimize main window after opening a database (under Options→Interface), your KeePass windows will also minimize after you have successfully entered your Master Password.






          share|improve this answer





















          • 3





            Out of curiosity, is there a reason why you can't enter the path to KeePass in the Program/script field directly, instead of as an argument to cmd.exe?

            – Kodos Johnson
            Jan 12 at 1:59













          • @KodosJohnson, initially I entered the path as you describe. That caused KeePass to prompt me when I restored my Windows, but KeePass' prompt did not have focus, so I needed to click on the Master Password input field before typing. The use of cmd.exe eliminates this need.

            – CODE-REaD
            Jan 12 at 16:35











          • Perhaps this could be of use to you: stackoverflow.com/questions/35988863/…. Also, maybe you need to add a delay somehow in the scheduled task.

            – Kodos Johnson
            Jan 18 at 17:07











          • @KodosJohnson, thank you. I considered sendKeys.bat but want to keep this solution as simple as possible. The latest revision (pointing start to the location of my KeePass database) seems to work reliably so I've updated my answer with it. Please let me know if there are any problems with this approach.

            – CODE-REaD
            Jan 19 at 14:44














          14












          14








          14







          (I answer my own question):



          I can find no way to configure KeePass itself to Prompt for master password when restored, so here is a workaround based on this superuser question:



          Create and save a new Windows Scheduled Task:




          1. Start Task Scheduler: WinAdministrative
            Tools→Task Scheduler
            , or Win+R and enter
            taskschd.msc

          2. In Task Scheduler, Action→Create Task

          3. In Create Task's General tab, name the task Run KeePass at unlock

          4. In Create Task's Triggers tab, click New... then for Begin the task: select On
            workstation unlock
            and click OK

          5. In Create Task's Actions tab, click New... then in the Program/script field enter "C:WINDOWSSystem32cmd.exe" and in the Add arguments (optional) field enter /c start "" <location of your KeePass database file> (the location of your KeePass database file appears in KeePass' main window title).

          6. Click OK in Create Task to save the task, then close the Task Scheduler window.


          Now when you unlock your system, Task Scheduler will execute KeePass, which will gain focus and prompt you for your Master Password. If you have KeePass configured to Minimize main window after opening a database (under Options→Interface), your KeePass windows will also minimize after you have successfully entered your Master Password.






          share|improve this answer















          (I answer my own question):



          I can find no way to configure KeePass itself to Prompt for master password when restored, so here is a workaround based on this superuser question:



          Create and save a new Windows Scheduled Task:




          1. Start Task Scheduler: WinAdministrative
            Tools→Task Scheduler
            , or Win+R and enter
            taskschd.msc

          2. In Task Scheduler, Action→Create Task

          3. In Create Task's General tab, name the task Run KeePass at unlock

          4. In Create Task's Triggers tab, click New... then for Begin the task: select On
            workstation unlock
            and click OK

          5. In Create Task's Actions tab, click New... then in the Program/script field enter "C:WINDOWSSystem32cmd.exe" and in the Add arguments (optional) field enter /c start "" <location of your KeePass database file> (the location of your KeePass database file appears in KeePass' main window title).

          6. Click OK in Create Task to save the task, then close the Task Scheduler window.


          Now when you unlock your system, Task Scheduler will execute KeePass, which will gain focus and prompt you for your Master Password. If you have KeePass configured to Minimize main window after opening a database (under Options→Interface), your KeePass windows will also minimize after you have successfully entered your Master Password.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 19 at 14:39

























          answered Jan 11 at 17:06









          CODE-REaDCODE-REaD

          323111




          323111








          • 3





            Out of curiosity, is there a reason why you can't enter the path to KeePass in the Program/script field directly, instead of as an argument to cmd.exe?

            – Kodos Johnson
            Jan 12 at 1:59













          • @KodosJohnson, initially I entered the path as you describe. That caused KeePass to prompt me when I restored my Windows, but KeePass' prompt did not have focus, so I needed to click on the Master Password input field before typing. The use of cmd.exe eliminates this need.

            – CODE-REaD
            Jan 12 at 16:35











          • Perhaps this could be of use to you: stackoverflow.com/questions/35988863/…. Also, maybe you need to add a delay somehow in the scheduled task.

            – Kodos Johnson
            Jan 18 at 17:07











          • @KodosJohnson, thank you. I considered sendKeys.bat but want to keep this solution as simple as possible. The latest revision (pointing start to the location of my KeePass database) seems to work reliably so I've updated my answer with it. Please let me know if there are any problems with this approach.

            – CODE-REaD
            Jan 19 at 14:44














          • 3





            Out of curiosity, is there a reason why you can't enter the path to KeePass in the Program/script field directly, instead of as an argument to cmd.exe?

            – Kodos Johnson
            Jan 12 at 1:59













          • @KodosJohnson, initially I entered the path as you describe. That caused KeePass to prompt me when I restored my Windows, but KeePass' prompt did not have focus, so I needed to click on the Master Password input field before typing. The use of cmd.exe eliminates this need.

            – CODE-REaD
            Jan 12 at 16:35











          • Perhaps this could be of use to you: stackoverflow.com/questions/35988863/…. Also, maybe you need to add a delay somehow in the scheduled task.

            – Kodos Johnson
            Jan 18 at 17:07











          • @KodosJohnson, thank you. I considered sendKeys.bat but want to keep this solution as simple as possible. The latest revision (pointing start to the location of my KeePass database) seems to work reliably so I've updated my answer with it. Please let me know if there are any problems with this approach.

            – CODE-REaD
            Jan 19 at 14:44








          3




          3





          Out of curiosity, is there a reason why you can't enter the path to KeePass in the Program/script field directly, instead of as an argument to cmd.exe?

          – Kodos Johnson
          Jan 12 at 1:59







          Out of curiosity, is there a reason why you can't enter the path to KeePass in the Program/script field directly, instead of as an argument to cmd.exe?

          – Kodos Johnson
          Jan 12 at 1:59















          @KodosJohnson, initially I entered the path as you describe. That caused KeePass to prompt me when I restored my Windows, but KeePass' prompt did not have focus, so I needed to click on the Master Password input field before typing. The use of cmd.exe eliminates this need.

          – CODE-REaD
          Jan 12 at 16:35





          @KodosJohnson, initially I entered the path as you describe. That caused KeePass to prompt me when I restored my Windows, but KeePass' prompt did not have focus, so I needed to click on the Master Password input field before typing. The use of cmd.exe eliminates this need.

          – CODE-REaD
          Jan 12 at 16:35













          Perhaps this could be of use to you: stackoverflow.com/questions/35988863/…. Also, maybe you need to add a delay somehow in the scheduled task.

          – Kodos Johnson
          Jan 18 at 17:07





          Perhaps this could be of use to you: stackoverflow.com/questions/35988863/…. Also, maybe you need to add a delay somehow in the scheduled task.

          – Kodos Johnson
          Jan 18 at 17:07













          @KodosJohnson, thank you. I considered sendKeys.bat but want to keep this solution as simple as possible. The latest revision (pointing start to the location of my KeePass database) seems to work reliably so I've updated my answer with it. Please let me know if there are any problems with this approach.

          – CODE-REaD
          Jan 19 at 14:44





          @KodosJohnson, thank you. I considered sendKeys.bat but want to keep this solution as simple as possible. The latest revision (pointing start to the location of my KeePass database) seems to work reliably so I've updated my answer with it. Please let me know if there are any problems with this approach.

          – CODE-REaD
          Jan 19 at 14:44


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1393243%2fcan-i-configure-keepass-to-prompt-for-master-key-password-on-windows-restore%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Probability when a professor distributes a quiz and homework assignment to a class of n students.

          Aardman Animations

          Are they similar matrix