Forum Discussion
Need to Change and Apply Ease of Access Aero-Snap settings with batch script without a restart
- Feb 05, 2021
I was able to modify the aformentioned Powershell script using the Get-ItemProperty and the Write-Output cmdlets to set a value to 1 or 0 based from the HKCU\Control Panel\Desktop\WindowArrangementActive registry value. This value is previously set by the user profile management software in our login process. I then "copied" my derived 0 or 1 value to the iParameter input variable for the SPI_SETWINARRANGING operation. This worked excellently as evidenced by many test logins and logouts using three regular non-privileged user ID's. If the user set the Checkmark on the Ease of Access panel before logoff, the subsequent login session had it CHECKED and vice versa. This solution appears to be one that could enable or disable programmatically the Aero Snap feature in Windows 10 after a change in the WindowArrangementActive registry value. Our user profile management team continues to look for their own resolution to the issue. I'll mark this as best answer so far.
ChevITGuy
The Settings -> System -> Multitasking panel has the "Snap windows" On-Off button that I am currently working with. Turning Snap windows button to ON and then UNCHECKING the three check boxes below, causes the SnapFill, JointResize, and SnapAssist Registry values to show up (value 0) in the HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced Registry Key. Again, saving and restoring this key is still not enough to keep the "Snap windows" button to be in the OFF position at the next login cycle in our non-persistent Win 10 Enterprise 64-bit Feature 20H2 systems.
ChevITGuy
Thanks to our User Profile Management support desk, we were able to locate Michael Albert's posting on Michael's own technical blog from July 16, 2013 using Power Shell to Disable the Aero Snap feature. I have NOT tried his posting on Windows 10 Professional or Enterprise x64 Feature 20H2 yet. Find Michael Albert's posting by searching on "SystemInfoByRef" in your favorite search engine. Michael's Power Shell script references the SPI_GETWINARRANGING (0x0082) and SPI_SETWINARRANGING (0x0083) API's from the System Parameters Info API set. His site offers a Download of "DisableAeroSnap.ps1" file for your examination. I've asked my User Profile Management support team members to see if their developers can generate a .EXE file and will read the HKCU\Control Panel\Desktop\WindowArrangementActive value (0 or 1) from the Registry and activate the appropriate Enable/Disable condition for the Aero Snap feature.
ChevITGuy
- ChevITGuyFeb 05, 2021Brass Contributor
I was able to modify the aformentioned Powershell script using the Get-ItemProperty and the Write-Output cmdlets to set a value to 1 or 0 based from the HKCU\Control Panel\Desktop\WindowArrangementActive registry value. This value is previously set by the user profile management software in our login process. I then "copied" my derived 0 or 1 value to the iParameter input variable for the SPI_SETWINARRANGING operation. This worked excellently as evidenced by many test logins and logouts using three regular non-privileged user ID's. If the user set the Checkmark on the Ease of Access panel before logoff, the subsequent login session had it CHECKED and vice versa. This solution appears to be one that could enable or disable programmatically the Aero Snap feature in Windows 10 after a change in the WindowArrangementActive registry value. Our user profile management team continues to look for their own resolution to the issue. I'll mark this as best answer so far.
ChevITGuy