Solved How to create Control Panel Icons View on desktop via Powershell?


CSharpDev

Member
Member
Local time
2:09 AM
Posts
180
OS
Win11
I need to modify my current script because it creates CP in Category View not IconsView

Powershell:
# Function to check if registry item exists
function Test-RegistryItem {
    param(
        [string]$Path,
        [string]$Name
    )
    return (Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue) -ne $null
}

# Function to set registry item
function Set-RegistryItem {
    param(
        [string]$Path,
        [string]$Name,
        [string]$Value
    )
    Set-ItemProperty -Path $Path -Name $Name -Value $Value
}

# Function to create new registry item
function New-RegistryItem {
    param(
        [string]$Path,
        [string]$Name,
        [string]$Value
    )
    New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType String
}

# Define registry path
$path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel"

# Define registry items
$items = @{
    "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" = 0  # This PC
    "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" = 0  # Network
    "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" = 0  # User's Files
   "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" = 0  # Control Panel
    "RecycleBin" = "{645FF040-5081-101B-9F08-00AA002F954E}"  # Recycle Bin
}

# Change the GUID for the Control Panel item to open in Icons View
$items["{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"] = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"

# Check and set registry items
foreach ($key in $items.Keys) {
    $value = $items[$key]
    $exist = Test-RegistryItem -Path $path -Name $key
    if ($exist) {
        Set-RegistryItem -Path $path -Name $key -Value $value
    }
    else {
        New-RegistryItem -Path $path -Name $key -Value $value
    }
}

How can I make it open in IconsView, how do I need to modify the script? @Brink thanks
 

My Computer

System One

  • OS
    Win11
That script just makes the Control Panel icon appear on the desktop. It doesn't set the view.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
ForceClassicControlPanel (REG_DWORD) 0x1
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
That script just makes the Control Panel icon appear on the desktop. It doesn't set the view.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
ForceClassicControlPanel (REG_DWORD) 0x1
I know. That's why I asked. But yours does right? Thank you

Do you happen to know

Documents, Settings, Downloads, Personal Folder, Network in the Start Menu?

Is this a registry setting or a group policy? Can someone drop the powershell code if so?

This is what I mean
 

My Computer

System One

  • OS
    Win11
Haven't a clue about the PowerShell end of it but, here's the CLSID for All Icons View:
{21EC2020-3AEA-1069-A2DD-08002B30309D}
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    ASUS ROG Strix
  • Operating System
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    ASUS VivoBook
OR, on THIS forum,


where you'll find

Control Panel (icons view)explorer "shell:::{21EC2020-3AEA-1069-A2DD-08002B30309D}"
 

My Computers

System One System Two

  • OS
    11 Pro 23H2 22631.3447
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i7-9700 @ 3.00GHz
    Motherboard
    Lenovo 3132
    Memory
    32GBDDR4 @ 2666MHz
    Graphics Card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    LG E2442
    Screen Resolution
    1920x1080
    Hard Drives
    1 x Samsung 970 EVO PLUS 500GB NVMe SSD, 1 x WD_BLACK SN770
    250GB NVMe SSD (OS and programs), 1 x WD_BLACK SN770
    500GB NVMe SSD (Data)
    Case
    Lenovo SFF
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Mouse
    LogiTech M510 wireless
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome, sometimes Firefox
    Antivirus
    Malwarebytes Premium & Defender (working together beautifully!)
  • Operating System
    11 Pro 23H2 22631.3447
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i5-8400 @ 2.80GHz
    Motherboard
    Lenovo 3132
    Memory
    32GB DDR4 @ 2600MHz
    Graphics card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek High Definition Audio onboard
    Monitor(s) Displays
    LG FULL HD (1920x1080@59Hz)
    Screen Resolution
    1920 x 1080
    Hard Drives
    1 x Samsung 970 EVO PLUS NVMe; 1 x Samsung 980 NVMe SSD
    Case
    Lenovo Think Centre SFF
    Mouse
    LogiTech M510 wireless
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome
    Antivirus
    Malwarebytes Premium and MS Defender, beautiful together
I need to modify my current script because it creates CP in Category View not IconsView

Powershell:
# Function to check if registry item exists
function Test-RegistryItem {
    param(
        [string]$Path,
        [string]$Name
    )
    return (Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue) -ne $null
}

# Function to set registry item
function Set-RegistryItem {
    param(
        [string]$Path,
        [string]$Name,
        [string]$Value
    )
    Set-ItemProperty -Path $Path -Name $Name -Value $Value
}

# Function to create new registry item
function New-RegistryItem {
    param(
        [string]$Path,
        [string]$Name,
        [string]$Value
    )
    New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType String
}

# Define registry path
$path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel"

# Define registry items
$items = @{
    "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" = 0  # This PC
    "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" = 0  # Network
    "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" = 0  # User's Files
   "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" = 0  # Control Panel
    "RecycleBin" = "{645FF040-5081-101B-9F08-00AA002F954E}"  # Recycle Bin
}

# Change the GUID for the Control Panel item to open in Icons View
$items["{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"] = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"

# Check and set registry items
foreach ($key in $items.Keys) {
    $value = $items[$key]
    $exist = Test-RegistryItem -Path $path -Name $key
    if ($exist) {
        Set-RegistryItem -Path $path -Name $key -Value $value
    }
    else {
        New-RegistryItem -Path $path -Name $key -Value $value
    }
}

How can I make it open in IconsView, how do I need to modify the script? @Brink thanks

Hello mate, :alien:

You would need to use the {21EC2020-3AEA-1069-A2DD-08002B30309D} GUID instead of {F02C1A0D-BE21-4350-88B0-7367FC96EF3C}.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    HP Spectre x360 2in1 14-eu0098nr (2024)
    CPU
    Intel Core Ultra 7 155H 4.8 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Graphics card(s)
    Integrated Intel Arc
    Sound Card
    Poly Studio
    Monitor(s) Displays
    14" 2.8K OLED multitouch
    Screen Resolution
    2880 x 1800
    Hard Drives
    2 TB PCIe NVMe M.2 SSD
    Internet Speed
    Intel Wi-Fi 7 BE200 (2x2) and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender and Malwarebytes Premium
Hello mate, :alien:

You would need to use the {21EC2020-3AEA-1069-A2DD-08002B30309D} GUID instead of {F02C1A0D-BE21-4350-88B0-7367FC96EF3C}.
Thank you

Do you happen to know how I can set these GPOs via Powershell? I can't find them in gpedit.msc

1708785883240.png
 

My Computer

System One

  • OS
    Win11
Thank you

Do you happen to know how I can set these GPOs via Powershell? I can't find them in gpedit.msc

You should be able to use the same command prompt command for them in PowerShell.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    HP Spectre x360 2in1 14-eu0098nr (2024)
    CPU
    Intel Core Ultra 7 155H 4.8 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Graphics card(s)
    Integrated Intel Arc
    Sound Card
    Poly Studio
    Monitor(s) Displays
    14" 2.8K OLED multitouch
    Screen Resolution
    2880 x 1800
    Hard Drives
    2 TB PCIe NVMe M.2 SSD
    Internet Speed
    Intel Wi-Fi 7 BE200 (2x2) and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender and Malwarebytes Premium
Please note that when you use shell:::{21EC2020-3AEA-1069-A2DD-08002B30309D} to open the Control Panel, you may get small or large icons, depending on the previous view setting in the regular Control Panel window or that particular window. Also note that the window will open to the size and position of the last Explorer window, whereas the regular Control Panel window has its own saved size and position.

If you apply the policy registry setting noted earlier:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer ForceClassicControlPanel (REG_DWORD) 0x1

Then, the regular methods of opening the Control Panel will always open in icon view (large or small depending on last selected). It will cause Category view to be ignored. This will allow you to avoid Category view and maintain the separate window size and position for Control Panel.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
You should be able to use the same command prompt command for them in PowerShell.
No I meant for those specific GPOs in my screenshot as I cannot find them. The ones in my OP are put on the desktop. I'm looking for the GPOs that will put those "icons" in the start menu right next to the username like I showed you. I ask because I cannot find them, I've looked everywhere in MS documentations
 

My Computer

System One

  • OS
    Win11
I don't know them. :(
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    HP Spectre x360 2in1 14-eu0098nr (2024)
    CPU
    Intel Core Ultra 7 155H 4.8 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Graphics card(s)
    Integrated Intel Arc
    Sound Card
    Poly Studio
    Monitor(s) Displays
    14" 2.8K OLED multitouch
    Screen Resolution
    2880 x 1800
    Hard Drives
    2 TB PCIe NVMe M.2 SSD
    Internet Speed
    Intel Wi-Fi 7 BE200 (2x2) and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender and Malwarebytes Premium
Google one of the settings by name, e.g. AllowPinnedFolderFileExplorer, and you'll find plenty of articles.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
How did you find out that was the name of one of them?
Well, I happen to know they are configured via CSP, not GPO. But you could search for "personalization" "start" "folders", which is how it is accessed via Settings, and maybe add the search term "PowerShell," and you'd start getting hits that are closer to what you want.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
Well, I happen to know they are configured via CSP, not GPO. But you could search for "personalization" "start" "folders", which is how it is accessed via Settings, and maybe add the search term "PowerShell," and you'd start getting hits that are closer to what you want.
I had no idea it was CSP all along, thanks, TIL. I love to learn.
 

My Computer

System One

  • OS
    Win11

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    HP Spectre x360 2in1 14-eu0098nr (2024)
    CPU
    Intel Core Ultra 7 155H 4.8 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Graphics card(s)
    Integrated Intel Arc
    Sound Card
    Poly Studio
    Monitor(s) Displays
    14" 2.8K OLED multitouch
    Screen Resolution
    2880 x 1800
    Hard Drives
    2 TB PCIe NVMe M.2 SSD
    Internet Speed
    Intel Wi-Fi 7 BE200 (2x2) and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender and Malwarebytes Premium
Back
Top Bottom