The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for May, 2023

Windows 10 and 11: installing WSL2 does not require winget, Chocolatey or Scoop

Posted by jpluimers on 2023/05/18

After using Chocolatey for a long time and writing about it, I have written a few articles on other Windows package managers like winget and Scoop.

Part of the reason was that I wanted to install new systems in a semi-automatic way including WSL2 (Windows Subsystem for Linux 2).

As I have spent quite some time getting treated against metastasised rectum cancer, I missed part of the evolvement of WSL into WSL2 and of the winget evolvement.

The good news is that this simplified the scripted installation of WSL2 a lot, as over time, this got very easy, as confirmed in these posts/messages I found via [Wayback/Archive] winget wsl2 – Google Search:

I even found back this was announced when I was still in hospital: during the Build 2020 conference. A summary is at [Wayback/Archive] The Windows Subsystem for Linux BUILD 2020 Summary – Windows Command Line describing the introduction of wsl.exe --install and that it defaults to install WSL 2 as back-then already most Windows Insider build users using WSL had switched from WSL 1 to WSL 2.

Back to installing

Yesterday, in  Windows “equivalents” for bash backticks in cmd and PowerShell, I showed how to get the wsl.exe information:

C:\temp>PowerShell -Command "SigCheck "$((Get-Command -CommandType Application wsl).Path)""

Sigcheck v2.82 - File version and signature viewer
Copyright (C) 2004-2021 Mark Russinovich
Sysinternals - www.sysinternals.com

c:\windows\system32\wsl.exe:
        Verified:       Signed
        Signing date:   09:24 15/10/2021
        Publisher:      Microsoft Windows
        Company:        Microsoft Corporation
        Description:    Microsoft Windows Subsystem for Linux Launcher
        Product:        Microsoft« Windows« Operating System
        Prod version:   10.0.19041.1320
        File version:   10.0.19041.1320 (WinBuild.160101.0800)
        MachineType:    64-bit

This was on one of my Windows 10 systems with version 21H2.

The installation progress was as follows and took ome 3 minutes on a 50 Mibit/s fiber connection:

C:\temp>wsl.exe --install
Installing: Virtual Machine Platform
Virtual Machine Platform has been installed.
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Downloading: WSL Kernel
Installing: WSL Kernel
WSL Kernel has been installed.
Downloading: Ubuntu
The requested operation is successful. Changes will not be effective until the system is rebooted.

Time to play around (:

–jeroen

Posted in Batch-Files, Chocolatey, Development, Power User, Scoop, Scripting, Software Development, Windows, Windows Development, winget, WSL Windows Subsystem for Linux | Leave a Comment »

Windows “equivalents” for bash backticks in cmd and PowerShell

Posted by jpluimers on 2023/05/17

A while ago, I needed the file information of wsl.exe on one of my Windows systems.

On Linux, I would do something like file `which bash` where file will give the file details and which gets you the full path to bash.

The file equivalent on Windows for me is [Wayback/Archive] Sigcheck – Windows Sysinternals | Microsoft Docs, which is part of [Wayback/Archive] File and Disk Utilities – Windows Sysinternals | Microsoft Docs.

The which equivalent on Windows for me is [Wayback/Archive] where | Microsoft Docs.

Read the rest of this entry »

Posted in bash, Batch-Files, CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | 1 Comment »

Bookmarklet-Youtube: Add all subscriptions to watch-later

Posted by jpluimers on 2023/05/16

Saved because I want to learn how to save a YouTube URL into a [Wayback/Archive] YouTube: Watch later play list, as doing it by hand takes at least 10 seconds per URL.

[Wayback/Archive] Bookmarklet-Youtube: Add all subscriptions to watch-later

–jeroen

Posted in Bookmarklet, Development, GoogleBookmarks, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers | Leave a Comment »

Getting the human readable Windows 10 version from the registry (via Super User)

Posted by jpluimers on 2023/05/15

[Wayback/Archive] powershell – How to get the windows version with command line? – Super User (thanks [Wayback/Archive] harrymc!)

The value can be found under registry key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion inside the value named DisplayVersion.
The following PowerShell command will get it:
(Get-Item "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue('DisplayVersion')
This seems to have been introduced in version 2004 (20H1).

–jeroen

Posted in Power User, Windows, Windows 10 | Leave a Comment »

Gazelle 02978 backlight pictures (via Bike Forums)

Posted by jpluimers on 2023/05/12

Since one of my bicycles got the same Gazelle 02978 backlight:

[Wayback/Archive] [Dutch bikes] Replacing Rollerbrake drum brake + Nexus 7s shifter – Bike Forums

Outside of Gazelle 02978 backlight

Outside of Gazelle 02978 backlight

Inside of Gazelle 02978 backlight

Inside of Gazelle 02978 backlight

The button on the back side (which you can press through the outer housing under the luggage carrier), is a simple on-off toggle, but you have to wait about 2 seconds between pressing twice (otherwise it won’t recognise the second press).

If I ever need to replace it, this is the current (at time of writing early 2022) replacement part number 8717118039984.

Read the rest of this entry »

Posted in LifeHacker, Power User | Leave a Comment »

Disabling the Windows 10 news (and weather) feeds

Posted by jpluimers on 2023/05/11

I finally got annoyed enough to figure out how to disable the Windows 10 news (and weather) feeds.

At first I thought the solution in this post worked for Windows 11 as well, but re-testing in Windows 11 it does not or does not (or not any more: given so many new Windows 11 releases with ever changing functionality I’m not surprised).

Disable Windows news feeds for current user

Failure: just disabling the news feed will automatically get it reset by explorer.exe

Based on the below sources, I made this small batch file:

Read the rest of this entry »

Posted in Batch-Files, Development, Power User, Registry Files, Scripting, Software Development, Windows, Windows 10, Windows 11 | Leave a Comment »

Mysk 🇨🇦🇩🇪 on Twitter: “Google has just updated its 2FA Authenticator app and added a much-needed feature: the ability to sync secrets across devices. TL;DR: Don’t turn it on. The new update allows users to sign in with their Google Account and sync 2FA secrets across their iOS and Android devices.…”

Posted by jpluimers on 2023/05/10

Do not use the Google 2FA Authenticator to to sync secrets across devices.

The why is explained in the (long) tweet by [Wayback/Archive] Mysk on Twitter: “Google has just updated its 2FA Authenticator app and added a much-needed feature: the ability to sync secrets across devices. TL;DR: Don’t turn it on. The new update allows users to sign in with their Google Account and sync 2FA secrets across their iOS and Android devices.…”

For similar reasons, you might not want to use Authy by Twilio to sync between devices either, though that is less insecure as it enforces you to use a backup-password in order to sync these through the cloud: in the past that backup-password had few security restrictions so it was easy to use a relatively insecure password.

Related (most in Dutch):

Read the rest of this entry »

Posted in 2FA/MFA, Authentication, Google, GoogleAuthenticator, Power User, Security | Tagged: , , , , | Leave a Comment »

Restart Windows explorer with an UAC administrator token

Posted by jpluimers on 2023/05/10

Sometimes, you want to restart the Windows explorer. This is already an exception case which you want to do when explorer hangs (for instance when taskbar icons do not respond any more), or has files locked which need to be modified. I described the latter in Inno Setup: Program Folder not showing up In Start > All Programs , with this very simple restart script:

taskkill /F /IM explorer.exe
start explorer

Even more exception is wanting to run explorer with a UAC elevated administrative token. I sometimes do this when moving around stuff from other users on the same computer without having them logged on (as that would lock the files or directories to be moved around).

The risk of running explorer under UAC elevation, is that any program you start will also start UAC elevated, so beware what you ask for…

This is how you start explorer under UAC elevation:

pwsh.exe -nol -noni -nop -w hidden -c "taskkill /f /im explorer.exe; start explorer -v runas -a /nouaccheck"

or if you run an older Windows version of PowerShell:

PowerShell.exe -nol -noni -nop -w hidden -c "taskkill /f /im explorer.exe; start explorer -v runas -a /nouaccheck"

These command-line options and verbs are used:

Time to explain a few:

Read the rest of this entry »

Posted in Batch-Files, CommandLine, Development, Power User, PowerShell, PowerShell, Scripting, Software Development, Windows, Windows 10, Windows 11, Windows 7, Windows 8.1 | 1 Comment »

I dug into scoop a tiny bit: some thoughts and links

Posted by jpluimers on 2023/05/09

Last month, I wrote Need to take a look a Scoop (as a long time Chocolatey user).

So I did, and started with a list of my Chocolatey installs grouped by functionality in order to expand the table towards winget and [Wayback/ArchiveGitHub – ScoopInstaller/Scoop: A command-line installer for Windows.

This was a good way to start learning, and by already doing this, got learned this:

  • Whereas Chocolaty has a global searchable community package index at [Wayback/Archive] Chocolatey Software | Packages  which is moderated too.
  • Scoops works differently. There are many buckets you can get your applications from, and there is no Scoop maintained index of them.

Let’s focus on the latter for a bit:

From the above, I got a feeling that Scoop is way more like the Linux Package Managers than WinGet and Chocolatey are.

–jeroen

Read the rest of this entry »

Posted in Chocolatey, Development, Power User, Scoop, Software Development, Windows, Windows Development, winget | Leave a Comment »

MXbord.nl – live kaart met matrixborden en portalen met snelheid/kruisen

Posted by jpluimers on 2023/05/08

Cool:

Was op 6 januari 2022 handig vanwege totale afsluiting A2 door een politieactie.

Via:

Gerelateerd:

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »