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 the ‘Windows’ Category

How to pin either a Shortcut or a Batch file to the new Windows 7, 8 and 10 Taskbar and start menu? – Super User

Posted by jpluimers on 2020/04/29

This nailed it: way easier than all the alternatives involving VB scripts, registry keys and Group Policy Editors.

  1. Create a shortcut to your batch file.
  2. Get into shortcut property and change target to something like: cmd.exe /C "path-to-your-batch".
  3. Simply drag your new shortcut to the taskbar

Source: [WayBackHow to pin either a Shortcut or a Batch file to the new Windows 7, 8 and 10 Taskbar and start menu? – Super User

The trick is step 2. After that you can modify back your shortcut to just the batch file.

–jeroen

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

KiTTY auto-reconnect ssh tunnel so you can RDP from remote machine into local one

Posted by jpluimers on 2020/04/27

I needed this equivalent in KiTTY while also keeping the connection alive:

ssh -o "ExitOnForwardFailure yes" -R :3389:127.0.0.1:3389 

Here, (via [WayBack] SSH options, Port Forwarding over SSH, Keepalives – zwilnik), -R Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side. This works by allocating a socket to listen to port on the remote side, and whenever a connection is made to this port, the connection is forwarded over the secure channel, and a connection is made to host port hostport from the local machine.

This is unlike most port forwarding examples which shows you how to forward a local port to a remote one (for instance [WayBack] Portforwarding with SSH (Putty)).

 

I wanted this on Windows, but auto connect, and not depend on OpenSSH. So I used the portable edition of [WayBack] Download KiTTY., which is a PuTTY derivative with more features.

With OpenSSH it is easier, but requires either Windows 10 (having it pre-installed) or an OpenSSH installation. How simple? This simple: [WayBack] openssh – How do I keep SSH connection alive on Windows 10? – Stack Overflow

The portable version of KiTTYensures all configuration is in configuration files (not the registry like the regular edition: [WayBack] KiTTY Session Configuration Location – Chase’s Notes)

I bumped into KiTTY because in another situation, I needed to execute a remote command and found [WayBack] ssh – How to run a remote command in PuTTY after login & keep the shell running? – Super User

Later I found other references as it can also auto-logon:

Kitty has a URL based update checker; for instance [WayBackwww.9bis.net/kitty/check_update.php?version=0.70.0.6 checks if a newer version than 0.70.0.6 is available. If you do not trust it, you can run that URL over TLS as well.

These screenshots seem to do just get the above configuration:

  1. Under “SSH”, in “Tunnels”
    • tick “Remote ports do the same (SSH-2 only)”
    • fill in a source port (that’s the remote port and will become the :3389: bit above)
    • fill in destination 127.0.0.1:3389 (that’s the local RDP port on your Windows machine)
    • tick “Remote”
    • tick “Auto”
    • click “Add” to get to the second screenshot

  2. Under connection:
    • Ensure “Seconds between keepalives” is larger than zero (I took 1)
    • Tick “Disable Nagle’s algorithm”
    • Tick “Enable TCP keepalives”
    • Tick “Attempt to reconnect on system wakup”
    • Tick “Attempt to reconnect on connection failure”
  3. On the “SSH” tab:
    • Do not enter a “Remote command” (seems unneeded on my system)

So for now, I can do without things like:

–jeroen

Posted in *nix, *nix-tools, Power User, ssh/sshd, Windows | Leave a Comment »

OSK: How to turn off auto start On-Screen Keyboard on Windows 7 64 bit? – Super User

Posted by jpluimers on 2020/04/27

Steps based on [WayBackHow to turn off auto start on-screen-keyboard on Windows 7 64 bit? – Super User.

  1. Turn down the volume of your PC
  2. Run “Control Panel”
  3. Choose “Ease of Access”, then “Ease of Access Center”
  4. Click “Use the computer without a mouse or keyboard”
    • If you forgot the sound settings, and they are at max: the narrative voice will probably deafen you
  5. Uncheck the “use on-screen keyboard” box
  6. Press “Apply” or “OK
  7. Close the “Control Panel”

I got in this situation when I selected the “On-Screen Keyboard” (often abbreviated to OSK; it is serviced by OSK.exe) on the logon screen in the “Ease of Access Center”. After that it would launch after each logon, even after I disabled it on the logon screen.

Back then I needed it because the VM ran on a Mac under Virtual Box which by default not only takes the left Command key, but also messes with some of the other left modifier keys.

The password for a new user I had to logon with needed the modifier keys, so it appears that the logon screen settings during the very first logon get copied to the user profile.

Turning them off on the logon screen does not copy them to the profile again:

Read the rest of this entry »

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

xrdp

Posted by jpluimers on 2020/04/06

I totally missed this the last 5 years. Where have I been (:

[WayBack] xrdp: An open source remote desktop protocol(rdp) server.

It runs on top of either Xvnc (which I have used) or X11rdp and should be usable with any RDP client (like the excellent Microsoft RDP for Mac OS X).

Related

Via:

–jeroen

Posted in *nix, *nix-tools, Power User, Remote Desktop Protocol/MSTSC/Terminal Services, VNC/Virtual_Network_Computing, Windows | Leave a Comment »

ODCB settings in the Windows registry on 32 and 64 bit windows

Posted by jpluimers on 2020/03/27

  • While 32-bit applications can run on 64-bit machines, they cannot use 64-bit ODBC drivers. A 64-bit application must use a 64-bit ODBC driver, and a 32-bit application must use a 32-bit ODBC driver.
  • ODBC.INI registry paths for the various permutations:
    • User DSNs for for 64-bit and 32-bit applications
      • HKEY_CURRENT_USER\Software\ODBC\ODBC.INI
    • System DSNs for 64-bit applications on 64-bit Windows and 32-bit applications on 32-bit Windows
      • HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI 
    • System DSNs for 32-bit applications on 64-bit Windows
      • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ODBC\ODBC.INI

Via: [WayBack] Windows registry on 32 and 64 bit windows, which also explains ODBCINST.INI to define drivers.

–jeroen

Posted in Database Development, Development, ODBC, Power User, Windows | Leave a Comment »

Chocolatey and TLS since early 2020

Posted by jpluimers on 2020/03/19

I was upgrading a few older systems that had been off-line for quite a while.

When installing Chocolatey, I bumped into this error:

C:\bin>"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Exception calling "DownloadString" with "1" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."
At line:1 char:1
+ iex ((New-Object System.Net.WebClient).DownloadString('https://chocol ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

So I tried [WayBack] chocolatey “The request was aborted: Could not create SSL/TLS secure channel.” – Google Search

Results indicated TLS 1.1 support was removed early February 2020 from Chocolatey because of security reasons, which impacts the installation on older systems:

Note [WayBack] Chocolatey install Error: The request was aborted: Could not create SSL/TLS secure channel – Stack Overflow with a temporary workaround for Microsoft Windows Server 2016:

Looks like the security protocol changed:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

–jeroen

Posted in Chocolatey, Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2016 | Leave a Comment »

Why you should not use localised operaring system versions

Posted by jpluimers on 2020/02/10

Using localised operating system versions means you have a really hard time finding the cause of an error.

In my case, a net share command gave me a Dutch “Systeemfout 1332.” “Er is geen toewijzing uitgevoerd tussen accountnamen en beveiligings-id’s.”.

Obviously searching for “net share” “Systeemfout 1332.” and “net share” “Er is geen toewijzing uitgevoerd tussen accountnamen en beveiligings-id’s.” delivered nothing, as a did shorter “net share” “Er is geen toewijzing uitgevoerd” only found [WayBack] Welkom bij ronald.repareert.com ….. sites door vrienden en kennissen which got me the error code 1332:

[WayBack] Error code 1332: No mapping between account names and security IDs was done.

This allowed me to search for “net share” “No mapping between account names and security IDs was done.” which did return some meaningful results:

The command I used was this:

mkdir D:\tmp$
net share tmp$=D:\tmp /unlimited /grant:everyone,full

The adding factor was that this was done on a machine inside a domain.

Since there was no group everyone inside the domain, it could not be bound to a SID.

Replacing the last command with net share vincent$=D:\Vincent$ /unlimited /grant:.\everyone,full or  net share vincent$=D:\Vincent$ /unlimited /grant:.\users,full dit get the same error.

But this succeeded, as gebruikers is the Dutch translation for users:

net share vincent$=D:\Vincent$ /unlimited /grant:.\gebruikers,full

So in the end:

  • use localised group names
  • be careful with group names not existing in the domain

If you wonder why I started with everyone in the first place: [WayBack] The Difference Between Everyone and Authenticated Users

In this case, the group .\everyone did not exist, not even in a translated fashion iedereen. The command net localgroup gives you an overview of existing local groups on the machine:

C:\WINDOWS\system32>net localgroup

Aliassen voor \\MYPCINDOMAIN

-------------------------------------------------------------------------------
*Administrators
*Apparaateigenaars
*Back-upoperators
*Cryptografie-operators
*DCOM-gebruikers
*Externe bureaubladgebruikers
*Gasten
*Gebruikers
*Gebruikers van extern beheer
*Hoofdgebruikers
*Hyper-V-administrators
*IIS_IUSRS
*Lezers van gebeurtenislogboeken
*Netwerkconfiguratieoperators
*Ondersteuningsoperators voor toegangsbeheer
*Prestatielogboekgebruikers
*Prestatiemetergebruikers
*Replicatie
*System Managed Accounts Group
De opdracht is voltooid.

I am still not sure why group iedereen does not exist, as I expected that to be there: [WayBack] Windows Built-in Users and Default Groups – Windows CMD – SS64.com.

It might have to do with newer Windows versions not supporting it (this machine was Windows 10, and it looks like Windows Server 2012 also has a problem: [WayBack] An error occurs while sharing folder on WS 2012 with net share command).

–jeroen

Posted in Power User, Windows | Leave a Comment »

Fixing “one or more critical volumes is not having enough free space” also known as 0x81000033 during Windows backup

Posted by jpluimers on 2020/02/03

If you get this error:

Backup and Restore failed and you receive the following error message: The backup did not complete successfully. Check your backup: Windows Backup skipped backing up system image because one or more critical volumes is not having enough free space.

then you are dealing with error 0x81000033 which usually means your SYSTEM RESERVED partition is full, but might happen on other volumes you are backing up as well.

Windows tries to trick your mind, as the error actually indicates the disk you make your backup to, but in fact it is about one or more of the disks you are backing up.

Most often, this is the hidden partition SYSTEM RESERVED (sometimes called System Reserved):

The SYSTEM RESERVED partition (~100 megabyte on systems originally installed with Windows < 8 and ~350 megabyte afterwards) contains files relating to boot, recovery and BitLocker drive encryption. You find more information about it here:

The minimum free size for volumes when using Windows backup are these:

  • volumes less than 500 megabytes: 50 megabytes free space
  • between 500 megabytes and 1 gigabytes: 320 megabytes of free space
  • more than 1 gigabytes: at least 1 gigabyte of free space

That was indeed the case on my disk:

Freeing space on the System Reserved volume

A quick search for 0x81000033 reveals space issues usually are about the USN Journal which you can configuring using fsutil.

Even though the documentation doesn’t tell, fsutil accepts not just a drive letter as VolumePath, but also a VolumeName. [WayBack] 1_multipart_xF8FF_3_WolfC07.pdf (Chapter 7 of “Troubleshooting Microsoft Technologies: The Ultimate Administrator’s Repair Manual“) gets that right:

volumepath … specify the path to a logical volume (drive letter, mount path, volume name).

So you do not need a drive letter to disable the USN journal, the volumename suffices.

This volume name is the unique NTFS identification for a volume: [WayBack] NTFS Curiosities (part 2): Volumes, volume names and mount points – Antimail

You can find the volume name inside PowerShell by using Get-Volume | Format-List, then on an administrative command prompt running this:

fsutil usn deletejournal /D \\?\Volume{b41b0670-0000-0000-00e8-0e8004000000}\

In my case this wasn’t enough, so I had to assign a drive letter to see that there was a snapshots directory in the root:

Deleting that directory solved the problem.

Related articles:

–jeroen

Read the rest of this entry »

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

When storing huge files under NTFS compression, ensure you have twice the disk space

Posted by jpluimers on 2020/01/31

When copying over a 400 gigabyte file over the network to an NTFS compressed folder on a drive with having 600 gigabytes free space, the volume became full after copying ~350 gigabytes.

What I learned is that compressing huge files for later read-only access is fine, but you need about twice the disk space while the copy operation is in progress.

For non-compressed files you can go without this extra reservation.

Background information:

Note there are also issues with NTFS compression and de-duplication. I’m not sure about sparse files. Be careful when you try to compress the system drive where your Windows OS lives on:

–jeroen

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

How to run Troubleshooter in Windows 10 from the command line

Posted by jpluimers on 2020/01/27

Learn how to run Hardware, Audio, Power Network, Windows Update, System Maintenance, App, Sound, etc, Troubleshooters in Windows 10/8/7 from the command line using MSDT.exe.

From:

Summary:

To invoke built-in Troubleshooters, use this command:

msdt.exe /id <diagnostic_id>

To run a custom-built troubleshooter stored locally use this command line:

msdt.exe /path <path_to_troubleshooter>

To run a troubleshooter which is in a .diagcab file format, use this:

msdt.exe /cab <path_to_diagcab>

List of diagnostic IDs:

Troubleshooting Pack ID Description Application or Feature Dependency
AeroDiagnostic Troubleshoots problems displaying Aero effects like transparency. Aero Display Theme installed
NetworkDiagnosticsDA Troubleshoots problems connecting to a workplace network over the Internet using Direct Access. Direct Access installed
DeviceDiagnostic Troubleshoots problems using hardware and access devices connected to the computer.
HomeGroupDiagnostic Troubleshoots problems viewing computers or shared files in a homegroup. HomeGroup installed
NetworkDiagnosticsInbound Troubleshoots problems with allowing other computers to communicate with the target computer through Windows Firewall.
NetworkDiagnosticsWeb Troubleshoots problems connecting to the Internet or to a specific Web site.
IEDiagnostic Helps the user prevent add-on problems and optimize temporary files and connections. Internet Explorer installed
IESecurityDiagnostic Helps the user prevent malware, pop-ups, and online attacks. Internet Explorer installed
NetworkDiagnosticsNetworkAdapter Troubleshoots problems with Ethernet, wireless, or other network adapters.
PerformanceDiagnostic Helps the user adjust settings to improve operating system speed and performance.
AudioPlaybackDiagnostic Troubleshoots problems playing sounds and other audio files. Audio output device installed
PowerDiagnostic Helps the user adjust power settings to improve battery life and reduce power consumption.
PrinterDiagnostic Troubleshoots problems printing.
PCWDiagnostic Helps the user configure older programs so that they can run in the current version of Windows.
AudioRecordingDiagnostic Troubleshoots problems recording audio from a microphone or other input source. Audio input device installed
SearchDiagnostic Troubleshoots problems with search and indexing using Windows Search. Search enabled
NetworkDiagnosticsFileShare Troubleshoots problems accessing shared files and folders on other computers over the network.
MaintenanceDiagnostic Helps the user clean up unused files and shortcuts and perform other maintenance tasks.
WindowsMediaPlayerDVDDiagnostic Troubleshoots problems playing a DVD using Windows Media Player. Windows Media Player installed
WindowsMediaPlayerLibraryDiagnostic Troubleshoots problems with adding media files to the Windows Media Player library. Windows Media Player installed
WindowsMediaPlayerConfigurationDiagnostic Helps the user reset Windows Media Player settings to the default configuration. Windows Media Player installed
WindowsUpdateDiagnostic Troubleshoots problems that prevent Windows Update from performing update tasks.

–jeroen

Posted in Power User, Windows | Leave a Comment »