Quickly connect to a VPN on Windows 10 (revisited)

Update (June ’17): it has taken more than 1,5 years since I posted this, but the Windows 10 “Creators Update” finally contains a Connect button right in the Network Connections flyout… 🙂

Earlier I wrote about a trick to make Windows 10 connect to a VPN with a single action (double-click) instead of three or more. I recently found that this trick had a limitation: it only worked because the username and password for my VPN connection were the same as the username and password of the Windows 10 computer I was using (a local account). On another Windows 10 pc that was using a Microsoft account, it failed telling me the username / password was not correct:

Remote Access error 691 – The remote connection was denied because the user name and password combination you provided is not recognized, or the selected authentication protocol is not permitted on the remote access server.

Because it worked on the first pc, I assumed that rasdial used the username/password I stored in the VPN configuration. It looks like it doesn’t, but uses your Windows username/password instead (need to verify this). One could discuss whether that is a bug or a feature, but in the end, the result is that it doesn’t work for me.

So I started looking for alternatives. Other tricks I found involved storing the username/password in the command file, but I did not want to do that. The solution is to not use rasdial, but it’s nephew rasphone.

Change the line

rasdial "My VPN connection name here"

into

rasphone -d "My VPN connection name here"

Mind the -d before the name of the connection.

It shows the familiar connecting dialog, instead of the command line window, and it just works.

Advertenties

You cannot use a null propagating operator in an expression tree lambda

One of the features I like about the new C# 6.0 is the null conditional operator, and I tend to use it everywhere I can (and should). Until yesterday, when at a statement I wasn’t expecting it, the compiler bit me with error CS8072, An expression tree lambda may not contain a null propagating operator. If you think about it, it makes sense, but it is easy to miss. Lees meer over dit bericht

Making TrueCrypt system favorite volumes stick in Windows 10

In the last paragraph of Upgrading a TrueCrypt-protected system to Windows 10 I wrote simply that you should re-add your secondary volumes to the system favorite volumes to have them mounted automatically. That turned out to be a bit too simple. Despite adding my data volume to system favorites, upon (re)boot the volume would sometimes be mounted and sometimes not. A reboot would always work correctly, but shutting down and booting later, the volume often disappeared.

This happens because of Windows 10’s hybrid quick boot scheme. (Which was also present in Windows 8, so this may be old news for some of you, but I went directly from 7 to 10 so I skipped that.) Lees meer over dit bericht