Add DisableNTFSLastAccess (#136)

This commit is contained in:
r3incarnat0r
2018-09-28 21:28:19 +02:00
committed by Disassembler0
parent c5c107c59f
commit e2646d13e4
2 changed files with 20 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ DisableAutorun # EnableAutorun
# DisableDefragmentation # EnableDefragmentation
# DisableSuperfetch # EnableSuperfetch
# DisableIndexing # EnableIndexing
# DisableNTFSLastAccess # EnableNTFSLastAccess
# SetBIOSTimeUTC # SetBIOSTimeLocal
# EnableHibernation # DisableHibernation
# DisableSleepButton # EnableSleepButton

View File

@@ -993,6 +993,25 @@ Function EnableIndexing {
Start-Service "WSearch" -WarningAction SilentlyContinue
}
# Disable the updating of the NTFS Last Access Time stamps
Function DisableNTFSLastAccess {
Write-Output "Disabling the updating of the Last Access Time stamps..."
# User Managed, Last Access Updates Disabled
fsutil behavior set DisableLastAccess 1 | Out-Null
}
# Enable the updating of the NTFS Last Access Time stamps
Function EnableNTFSLastAccess {
Write-Output "Enabling the updating of the Last Access Time stamps..."
If ([System.Environment]::OSVersion.Version.Build -ge 17134) {
# System Managed, Last Access Updates Enabled
fsutil behavior set DisableLastAccess 2 | Out-Null
} Else {
# Last Access Updates Enabled
fsutil behavior set DisableLastAccess 0 | Out-Null
}
}
# Set BIOS time to UTC
Function SetBIOSTimeUTC {
Write-Output "Setting BIOS time to UTC..."