Disassembler0 / Win10-Initial-Setup-Script

PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
MIT License
4.7k stars 1.07k forks source link

Arrow in shortcut icons #156

Closed Mipeli closed 6 years ago

Mipeli commented 6 years ago

Add disable and enable arrow in shortcut icons.

Thank you Miceli

Disassembler0 commented 6 years ago

Is this supposed to be a feature request? Or did you actually make a patch for it and just PR'd the wrong thing?

Mipeli commented 6 years ago

It is a request.

Disassembler0 commented 6 years ago

Original tweak sent via mail

# Disable adding 'arrow' to desktop icons
Function DisableArrowInIcons {
    Write-Output "Disabling adding 'arrow' to desktop icons..."
    If (!(Test-Path "HKCR:")) {
        New-PSDrive -Name "HKCR" -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" | Out-Null
    }
    Remove-ItemProperty -Path "HKCR:\lnkfile" -Name "IsShortcut" -ErrorAction SilentlyContinue
    Remove-ItemProperty -Path "HKCR:\piffile" -Name "IsShortcut" -ErrorAction SilentlyContinue
}

# Enable adding 'arrow' to desktop icons
Function EnableArrowInIcons {
    Write-Output "Enabling adding 'arrow' to desktop icons..."
    If (!(Test-Path "HKCR:")) {
        New-PSDrive -Name "HKCR" -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" | Out-Null
    }
    Set-ItemProperty -Path "HKCR:\lnkfile" -Name "IsShortcut" -Type String -Value ""
    Set-ItemProperty -Path "HKCR:\piffile" -Name "IsShortcut" -Type String -Value ""
}

Eventually reimplemented differently in 5b2333ba35731d5db16755833cd6ffd17e873ec6 as the IsShortcut modification seems a bit dangerous.