[C#] 纯文本查看 复制代码 @echo off
echo Removing readonly attribute and modifying timestamps for all files and folders (including current)...
echo This may take a while. Please wait...
powershell -Command "$items = @(Get-Item .) + @(Get-ChildItem -Recurse); $items | ForEach-Object { try { $_.Attributes = $_.Attributes -band -bnot [System.IO.FileAttributes]::ReadOnly } catch {}; $rndMin = Get-Random -Min 0 -Max 60; $rndSec = Get-Random -Min 0 -Max 60; $dateStr = '2025-11-19 11:' + $rndMin.ToString('00') + ':' + $rndSec.ToString('00'); $dt = Get-Date $dateStr; try { $_.CreationTime = $dt; $_.LastWriteTime = $dt; $_.LastAccessTime = $dt; } catch {} }"
echo Done!
pause
参考研究 |