Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • If you're willing to do some light automation legwork, use autoit to start the VPN app and then copy the password into the password field Commented Dec 8, 2013 at 16:14
  • 2
    Please, what is the advantage of echo|set /p=MyPassword|clip compared to just echo MyPassword|clip?
    – bers
    Commented Jan 27, 2015 at 18:49
  • 3
    @bers If you use just echo your_pass| clip it will also put/append the new line character at the end of your_pass. Just try it yourself and when you paste it in some editor you'll notice that the cursor is on the next line (if you have an editor that can show new line characters, like Notepad++ or SciTE, use it and you will see CRLF on Windows at the end of your_pass). But MikeZ's current solution works perfectly (as a way of copying a password to the clipboard). Commented Jun 20, 2015 at 15:40
  • 1
    @informatik01 Thanks for the explanation!
    – bers
    Commented Jun 20, 2015 at 20:26
  • 2
    (1) @informatik01’s excellent explanation doesn’t fully address the need for the echo| at the beginning of the command line.  The reason is that set /p is the command to read a value (a line) from the standard input.  Without echo|, the set /p=MyPassword|clip command would silently sit and read a line from the terminal.  (2) I hate to see a | without spaces before and after.  But beware that echo | set /p=MyPassword | clip will write MyPassword  (with a trailing space) to the clipboard.  You can prevent that by adding quotes: echo | set /p="MyPassword" | clip. Commented Sep 11, 2018 at 4:53