How to reduce system tray icon spacing?

Page 2 of 2 FirstFirst 12

  1. Posts : 170
    Win 10 Pro 2004
       #11

    After a closer look at Win 10 Powershell I see it has evolved and the DeviceManager addins are not needed. Big difference between Win 7 PS but I'm learning. The following script toggles touchscreen. If touchscreen is on, it disables it. If touchscreen is off, it attempts to enable it. It requires admin rights and the only qualifying it performs is identifying the touchscreen device. It is quick and dirty and may bomb when PS evolves. Tested and ran in PS ISE.

    Code:
    $TouchScreen = Get-PnpDevice -FriendlyName 'HID-Compliant Touch Screen'
    if ( $TouchScreen.Status -eq 'OK' ) { $TouchScreen | Disable-PnpDevice -confirm:$false }
     else { $TouchScreen | Enable-PnpDevice -confirm:$false }
      My Computers


  2. Posts : 11,390
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #12

    xips,

    Thanks, I'll experiment with it. Oh & thanks for the links as well, they are interesting.

    And adding in elevation using one of the links you provided gives this as the final result [tested a few times already and it seems reliable] -

    # Escalate privileges if not admin
    If (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
    $Arguments = "& '" + $MyInvocation.mycommand.definition + "'"
    Start-Process powershell -Verb runAs -ArgumentList $Arguments
    Break
    }
    $TouchScreen = Get-PnpDevice -FriendlyName 'HID-Compliant Touch Screen'
    if ( $TouchScreen.Status -eq 'OK' ) { $TouchScreen | Disable-PnpDevice -confirm:$false } else { $TouchScreen | Enable-PnpDevice -confirm:$false }


    The system tray icon spacing does close up / open up as the touchscreen is disabled / re-enabled.

    Denis
      My Computer


  3. Posts : 1
    Windows 10 1903
       #13

    xips said:
    There is a work around if you are willing to lose touch screen capability. In Device Manger disable HID-compliant touch screen. If you need touch screen, a powershell script will toggle it fast.
    Thanks
      My Computer


  4. Posts : 1
    Windows 10
       #14

    Install free software 7+ Taskbar Tweaker, right click on the 7TT system tray icon and choose Advanced Options, find tray_icons_padding, and set to 1 or another value smaller than the default of 8
      My Computer


  5. Posts : 4
    Windows 10 64bit Home
       #15

    This worked for me


    I found my way to this site trying to do the same thing, move the icons closer to each other. When I Google'd "How to adjust icon spacing/padding Windows 10" I opened the first 3 tabs of results. After reading this page, I found on the next one a way of fixing it. Being that nobody gave you a straight answer, and for those who follow after me, here is a link to the "step-by-step" on how to adjust icon spacing in your taskbar.

    Taskbar icon spacing is too wide in Windows 11/10 or Surface Pro device
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 21:30.
Find Us




Windows 10 Forums