⚡ PowerShell 5.1+
Check "Enable Win32 Long Paths" Status
Reads the current registry value behind the "Enable Win32 Long Paths" tweak so you can confirm whether it's applied.
Test-EnableLongPathsStatus.ps1
<#
.SYNOPSIS
Checks whether "Enable Win32 Long Paths" is currently applied.
.DESCRIPTION
Reads HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem \ LongPathsEnabled and reports its current value,
or reports that it isn't set (falling back to the Windows default).
.EXAMPLE
.\Test-EnableLongPathsStatus.ps1
#>
[CmdletBinding()]
param()
$regPath = 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem'
$value = Get-ItemProperty -Path $regPath -Name 'LongPathsEnabled' -ErrorAction SilentlyContinue
if ($null -eq $value) {
Write-Host "'LongPathsEnabled' is not set at $regPath (using the Windows default)." -ForegroundColor Yellow
} else {
Write-Host "Current value of 'LongPathsEnabled': $($value.'LongPathsEnabled')" -ForegroundColor Green
}