Hi rae
You can do this using PowerShell script that resets desktop icons to the "Auto Arrange" and "Medium Icons" settings. This script can be scheduled to run at user logon through Task Scheduler.
Create a new PowerShell script like the one below
# ArrangeIcons.ps1
# Set the registry values for Auto Arrange and Medium Icons
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\Shell\Bags\1\Desktop' -Name 'LogicalViewMode' -Value 1
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\Shell\Bags\1\Desktop' -Name 'IconSize' -Value 0
# Send a broadcast message to refresh the desktop
$signature = @"
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int SendMessageTimeout(
IntPtr hWnd,
uint Msg,
UIntPtr wParam,
UIntPtr lParam,
SendMessageTimeoutFlags fuFlags,
uint uTimeout,
out UIntPtr lpdwResult
);
[Flags]
public enum SendMessageTimeoutFlags : uint {
SMTO_NORMAL = 0x0,
SMTO_BLOCK = 0x1,
SMTO_ABORTIFHUNG = 0x2,
SMTO_NOTIMEOUTIFNOTHUNG = 0x8
}
public const int HWND_BROADCAST = 0xFFFF;
public const int WM_SETTINGCHANGE = 0x001A;
"@
Add-Type -MemberDefinition $signature -Namespace NativeMethods -Name User32
[NativeMethods.User32]::SendMessageTimeout([IntPtr]::Zero, [NativeMethods.WM_SETTINGCHANGE], [UIntPtr]::Zero, [UIntPtr]::Zero, [NativeMethods.SendMessageTimeoutFlags]::SMTO_NORMAL, 1000, [IntPtr]::Zero) | Out-Null
Save the script.
save the script and now create a task Scheduler task to run this script at user logon.
If this heps kindly accept the answer thanks much.