以隐藏的D:\Ghost和D:\Ghost\Backup.GHO为例
cmd命令:
代码语言:bash复制attrib +s +h +r /s /d D:\Ghost
attrib -s -h -r /s /d D:\Ghost
cd /d "D:\Ghost"
attrib +s +h +r /s /d *.*
attrib -s -h -r /s /d *.*
上面几句cmd命令对应的powershell命令如下
Get-Item -Path "D:\Ghost" -Force | ForEach-Object { attrib +H +S +R $_.FullName }
Get-Item -Path "D:\Ghost" -Force | ForEach-Object { attrib -H -S -R $_.FullName }
Set-Location -Path "D:\Ghost"
Get-ChildItem -Path "D:\Ghost" -Recurse -Force | ForEach-Object { attrib +H +S +R $_.FullName }
Get-ChildItem -Path "D:\Ghost" -Recurse -Force | ForEach-Object { attrib -H -S -R $_.FullName }powershell命令:Set-ItemProperty只能设置以下属性: Archive、Hidden、Normal、ReadOnly 或 System。
代码语言:powershell复制Set-ItemProperty -Path "D:\Ghost" -Name Attributes -Value Normal
Set-ItemProperty -Path "D:\Ghost\Backup.GHO" -Name Attributes -Value Normalpowershell命令:Clear-ItemProperty
代码语言:powershell复制Set-ItemProperty -Path "D:\Ghost" -Name Attributes Hidden
Clear-ItemProperty -Path "D:\Ghost" -Name Attributes
Clear-ItemProperty -Path "D:\Ghost\Backup.GHO" -Name Attributes如果没有Administrator权限,如此恢复
cmd:
代码语言:bash复制TAKEOWN /F D:\Ghost /A /R /D Y
ICACLS D:\Ghost /T /grant :r Administrators:Fpowershell:
代码语言:powershell复制cmd.exe /c "TAKEOWN /F D:\Ghost /A /R /D Y"
cmd.exe /c "ICACLS D:\Ghost /T /grant :r Administrators:F" 可以通过系统本身修改属性(如果设置了五种属性中的System属性,则无法通过图形界面去除,只能通过命令行),也可以通过第三方文件属性修改器(搜了下有很多),比如UltraFileExternal.exe
类似的,也有专门修改文件3个时间戳的第三方工具,比如NewFileTime。