Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 5db2e9e

Browse files
committed
Add "Enable NTFS long paths", closes #233
1 parent c37015a commit 5db2e9e

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Default.preset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ DisableAutorun # EnableAutorun
7777
# DisableSuperfetch # EnableSuperfetch
7878
# DisableIndexing # EnableIndexing
7979
# DisableSwapFile # EnableSwapFile
80+
EnableNTFSLongPaths # DisableNTFSLongPaths
8081
# DisableNTFSLastAccess # EnableNTFSLastAccess
8182
# SetBIOSTimeUTC # SetBIOSTimeLocal
8283
# EnableHibernation # DisableHibernation

Win10.psm1

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,16 +1161,28 @@ Function EnableSwapFile {
11611161
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "SwapfileControl" -ErrorAction SilentlyContinue
11621162
}
11631163

1164-
# Disable the updating of the NTFS Last Access Time stamps
1164+
# Enable NTFS paths with length over 260 characters
1165+
Function EnableNTFSLongPaths {
1166+
Write-Output "Enabling NTFS paths with length over 260 characters..."
1167+
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Type DWord -Value 1
1168+
}
1169+
1170+
# Disable NTFS paths with length over 260 characters
1171+
Function DisableNTFSLongPaths {
1172+
Write-Output "Disabling NTFS paths with length over 260 characters..."
1173+
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Type DWord -Value 0
1174+
}
1175+
1176+
# Disable updating of NTFS last access timestamps
11651177
Function DisableNTFSLastAccess {
1166-
Write-Output "Disabling the updating of the Last Access Time stamps..."
1178+
Write-Output "Disabling updating of NTFS last access timestamps..."
11671179
# User Managed, Last Access Updates Disabled
11681180
fsutil behavior set DisableLastAccess 1 | Out-Null
11691181
}
11701182

1171-
# Enable the updating of the NTFS Last Access Time stamps
1183+
# Enable updating of NTFS last access timestamps
11721184
Function EnableNTFSLastAccess {
1173-
Write-Output "Enabling the updating of the Last Access Time stamps..."
1185+
Write-Output "Enabling updating of NTFS last access timestamps..."
11741186
If ([System.Environment]::OSVersion.Version.Build -ge 17134) {
11751187
# System Managed, Last Access Updates Enabled
11761188
fsutil behavior set DisableLastAccess 2 | Out-Null

0 commit comments

Comments
 (0)