I need to modify my current script because it creates CP in Category View not IconsView
How can I make it open in IconsView, how do I need to modify the script? @Brink thanks
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