0

I need to get and display in CLI the settings values of "Location", "Action Center" and "Touch Keyboard" under [Start > Settings > Personalization > Taskbar > Turn system icons on or off] whether they are turned on or off using batch script or powershell.

Previous Header: I need to implement this script using Batch Script or PowerShell. First, I'm searching for a valid and existing (by default) Registry Path for [Turn system icons on or off] settings for "Location", "Action Center" and "Touch Keyboard".

Windows Setting: Turn system icons on or off

As of now, the Registry Path of HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer (Given by Microsoft CoPilot) is not relevant because the Windows Settings in question must be configured via Group Policy to be able to reflect their Registry Key on that path.

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"

Another Registry Path of HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer (Given by ChatGPT) does not seem to work because of a non-existing Registry Key despite the Windows Settings in question being turned off.

reg query "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"

This one is also not working even though I have already changed its value from default.

@echo off
    setlocal enabledelayedexpansion
    
    set KEY="HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify"
    
    echo Checking system icon visibility status...
    echo.
    
    for %%I in (HideClock HideSCAVolume HideSCANetwork HideSCAPower HideInputIndicator HideLocation HideActionCenter) do (
        reg query %KEY% /v %%I >nul 2>&1
        if !errorlevel!==0 (
            for /f "tokens=3" %%A in ('reg query %KEY% /v %%I ^| find "%%I"') do (
                if %%A==0x1 (
                    echo %%I: Hidden
                ) else if %%A==0x0 (
                    echo %%I: Shown
                ) else (
                    echo %%I: Unknown value %%A
                )
            )
        ) else (
            echo %%I: Default ^(Not Set^)
        )
    )
    
    endlocal
    pause

Here's the output

> HideClock: Default (Not Set)
> HideSCAVolume: Default (Not Set)
> HideSCANetwork: Default (Not Set)
> HideSCAPower: Default (Not Set)
> HideInputIndicator: Default (Not Set)
> HideLocation: Default (Not Set)
> HideActionCenter: Default (Not Set)

I'm open to ANY kind of solutions (Not limited to Registry Path only), even complicated ones.

I also need to know if the implementations I requested are currently not possible to implement, for documentation purposes only.

6
  • This question rather belongs to superuser.com. And why did you actually add the PowerShell tag? Commented Apr 21 at 7:36
  • What do you mean by that? Commented Apr 21 at 7:49
  • In the question you initially posted it wasn't about code at all. Now it seems like you're asking for someone to code it for you. That's not how SO works actually. We expect you to make an own attempt to get your things done. You may take the Tour if you haven't yet and stop by on the help topic about How to Ask a good and valid question. Commented Apr 21 at 9:41
  • Actually, I have already tried to implement it in batch script and powershell using Registry Path (reg query) and any other types of commands. I have already mentioned the Registry Paths that I tried (if you read it). That is why I was able to say the result, but it was not working as intended, so I posted it here and asked what commands I could use. Commented Apr 21 at 10:02
  • Again: We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further. Commented Apr 21 at 11:10

1 Answer 1

0

In addition to what Olaf already said. An additional piece of information that would be useful is. . .

Are you talking about Windows Server 2025?

If so I had working code to remove certain systm tray icons but Microsoft has completely removed System Tray icons from the control panel as well as making Windows ignore those registry keys in Server 2025. Let's hope they find their mistake and fix it.

Here is some sample code you could use to try and convert your batch file to PowerShell commands or scripts, but keep in mind it's not just you it's broken in Server 2025.


## Turn off Volume Control in the system tray
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAVolume -Value 1 -PropertyType DWORD
Sign up to request clarification or add additional context in comments.

3 Comments

The question is tagged windows-10. Generally, please use a comment to ask for such clarifications. Note that converting the batch file in the question to PowerShell isn't what this question is about and that you're targeting a different registry key path.
The machines I'm using are Windows 10 Enterprise 2016 LTSB, Enterprise LTSC 2019 and IoT Enterprise LTSC 2021.
I'm looking for a read command instead of modifying or turning on/off the settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.