Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Thursday, November 6, 2025

Hide that annoying task bar keyboard button in Win11

https://superuser.com/a/1840006/127297:

  • In Settings, type "Advanced keyboard settings" into the search field and click it
  • In the Advanced keyboard settings window, enable "Use the desktop language bar when it's available"
  • Click "Language bar options" and set Language bar to "Hidden"
  • Click OK.



Sunday, August 27, 2023

Use diskpart CLI to reformat a Linux boot USB flash drive

Useful for reformatting a flash drive after using it as a Linux boot drive. 

In a Windows 10 command prompt, running as administrator:

C:\Windows\system32>diskpart

Microsoft DiskPart version 10.0.19041.964

Copyright (C) Microsoft Corporation.

On computer: YOURPC

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          476 GB  1024 KB        *
  Disk 1    Online          931 GB  1024 KB        *
  Disk 2    Online         7396 MB  4509 MB        *

DISKPART> select disk 2
Disk 2 is now the selected disk.

DISKPART> clean
DiskPart succeeded in cleaning the disk.

DISKPART> create partition primary
DiskPart succeeded in creating the specified partition.

DISKPART> format fs=fat32 quick
  100 percent completed

DiskPart successfully formatted the volume.

DISKPART> exit
Leaving DiskPart...

Thursday, January 26, 2023

How to recover an off-screen window in Windows

 Recover an off-screen window:

  1. Select the window's tab in the task bar
  2. Press Alt+Spacebar to open the window's context menu
  3. Press M to select Move in the context menu
  4. Press an arrow key to snap the mouse pointer to the window
  5. Move your mouse around until it drags the window back into view

Tuesday, February 22, 2022

Canadians! How to turn off that annoying "Control-Shift" Keyboard Switch

No offense to mon copains Quebecois (did I say that right?), but a particular quirk affects PCs for a unilinguist Anglo like me when the Region setting in Windows is set to Canada (or I suppose any bilingual country). 

I've had the annoying experience of holding down "Control-Shift" for more than a couple of seconds, say while I'm trying to decide if I want to paste plain text into a Google Chrome field (using Ctrl-Shift-V), then suddenly I'm getting accented characters all over the place. 

This is Windows being helpful to us Canucks, by switching the keyboard layout from Canadian English to Canadian French, which would be great, if a) I had a Canadian French keyboard, and b) I knew how to write in Canadian French on that keyboard, and c) I actually wanted to write in Canadian French!

Well, I discovered how to turn off that 'helpful' keyboard shift:

  1. Open Settings and search for "advanced keyboard settings":


  2. In the Advanced Keyboard Settings panel, click on Language bar options:
  3. In the Text Services and Input Languages control panel, select the "Advanced Key Settings" tab and click the "Change Key Sequence" button:


  4. Finally we are there: click the "Not Assigned" radio buttons for either or both "Switch Input Language" or "Switch Keyboard Layout" options:
And that I think is it!

Wednesday, June 23, 2021

Using Windows Command Line to make a dummy file

Echo 64 bytes to a seed file: 

C:\Temp>echo This is just a sample line appended to create a bi wefhwef weh> dummy8.txt

Then call 'type' in a for loop to append the contents of the file to itself:

C:\Temp>for /L %i in (1,1,8) do type dummy.txt >> dummy.txt

Makes a  32,768 byte (32Kb) file.

Courtesy https://www.windows-commandline.com/how-to-create-large-dummy-file/


Thursday, May 14, 2020

Don't name ANYTHING AUX, or NUL, or...

Further to my earlier post, I discovered 'aux' is not just a bad choice for folder names, it's bad for ANY file name on Windows!

Apparently back in the Dark Ages (1974 or so) when Bill Gates invented computers, the Interwebs and everything else digital, AUX, NUL, COM3, etc. were deemed names reserved for the OS, "magical files" if you will. That decision lives on through backward-compatibility (c'mon, 1974?! CP/M?! DOS?!?!?).

While working on my project, MS Visual Studio Code happily agreed to let me name a file"aux.yaml". Even though this ominous warning appeared, it let me continue once I appended "yaml" to the name:


 Everything went fine until I tried to add the file to the project's working copy in Subversion. For some reason, no matter how many times I pressed "Add..." in TortoiseSVN, the file refused to appear in the commit list, and failed to adopt its stroppy little blue plus sign in Windows Explorer.

Hmm, let's open it with Notepad++ to make sure the file is OK - nope, Notepad++ complained bitterly about the file when I tried to open it:



So at this point I figure the file was somehow corrupted by my attempts to add it or move it around in the Subversion working copy, let's just nuke it and start over:


OK this is definitely weird.

A few minutes googling produced the answer: open an admin command prompt and delete or rename the file. The command ren \\.\C:\path\to\file\aux.yaml auxiliary.yaml put everything right again - TortoiseSVN happily added the file, Notepad++ opened it with nary a whimper, and Visual Studio Code - well, let's just say it has it's own opinion on file names.

References:

How a 1974 bug still bites Win10 and Azure users

Monday, May 11, 2020

Windows error naming folder 'aux' - wat?!


Windows complained, unjustly I thought, when I tried to name a folder 'aux'. Turns out this is one of a number of restricted MSDOS device files:

CON, PRN, AUX, CLOCK$, NUL
COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9
LST (only in 86-DOS and DOS 1.xx)
KEYBD$, SCREEN$ (only in multitasking MS-DOS 4.0)
$IDLE$ (only in Concurrent DOS 386, Multiuser DOS and DR DOS 5.0 and higher)
CONFIG$ (only in MS-DOS 7.0-8.0)

Thursday, September 19, 2019

How to Get a Good Old Command Prompt from Windows Explorer in the latest Windows 10

Remember the ol' shift-click in Windows Explorer trick to open a command prompt from a folder?


Windows 10 since version 1803 (?) helpfully offers to open a Powershell prompt instead:


Which is great, if I want Powershell, which I don't. Apparently there's no way to revert or override this helpful 'feature', so I went around the side door - I shift-clicked to open Powershell, then typed "cmd" at the Powershell prompt, et voila, I get a good old command prompt in the folder:


Wednesday, December 19, 2018

Count directories with Windows command line

cd C:\Foo

REM Foo contains 2 files and 3 folders
dir /b
file1.txt
file2.txt
Folder1
Folder2
Folder3

REM Filter out files and '.' and '..' folders
for /f %i in ('dir /b /ad-s-h ^| find /i /v /c ""') do @echo %i
3