0

There are a few questions and answers within StackOverflow relating to programmatically changing mouse pointer size. Those questions are often mislabelled as "cursor size". e.g. Change and update the size of the cursor in Windows 10 via PowerShell. Windows itself refers to "cursor" as the blinking line when editing text. This question is about the blinking line cursor.

I have found out how to change the caret/cursor size for Notepad++ with PowerShell:

$NotepadConfig = "C:\Program Files\Notepad++\config.xml"
if (Test-Path $NotepadConfig) {
    (Get-Content -path $NotepadConfig -Raw) -replace '"Caret" width="1"','"Caret" width="3"' | Set-Content -Path $NotepadConfig
}

This is great, but only applies to Notepad++. I'd like to also change the general cursor/caret size for Windows (Start > search for "Change Cursor Thickness" to see the control panel for this).

Is there a way to programmatically change this value with PowerShell (I have not found out how in many searches)?

It would also be nice to be able to toggle the "Turn on text cursor indicator" option that is there if possible (presumably all of these settings are in the registry)?

YorSubs
  • 3,194
  • 7
  • 37
  • 60
  • I don't understand the first paragraph. Was this supposed to be a meta.stackoverflow.com post? – Mathias R. Jessen Sep 02 '22 at 11:35
  • There are a number of questions on StackOverflow relating to this, yes, and it's specifically about programmatically updating these UI elements, so StackOverflow is clearly the correct location for this. I have updated the question to point to a related question on mouse pointer size (this is related, as it's also a UI element and falls within the same area of UI control panels in windows). – YorSubs Sep 02 '22 at 11:44
  • But your question is not about mouse pointers? – Mathias R. Jessen Sep 02 '22 at 11:49
  • Sorry if the mouse pointer / cursor point is confusing, I have tried to update the question and title to reflect this (the other question that I link to is about "mouse pointer size" but is mislabelled as "cursor size"; Microsoft use "cursor" to mean the blinking line in front of text as you are editing and Microsoft do not refer to the "mouse pointer" as "cursor", so my question is about what Microsoft call the "text cursor" or caret). – YorSubs Sep 02 '22 at 12:04

1 Answers1

0

There are posibly more native ways of doing this, and Microsoft likes to spread these settings from one page of new control panel to separate locations in the registry, so here they are:

Text cursor width

HKEY_CURRENT_USER\Control Panel\Desktop
Cursor Width
32bit DWORD (1-20)

Color of text cursor

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Accessibility\CursorIndicator
IndicatorColor
32bit DWORD (hex values in BGR order ff00bf for magenta)

Turn coloring of cursor on

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility
Configuration
String "" (empty) for off and "cursorindicator" (without quots)
DaSe
  • 64
  • 5
  • That's great, thanks. I'll test some tweaks of these values (probably will require a restart of the Explorer process once I have done that). – YorSubs Sep 02 '22 at 13:14