Skip to content

bat

Enable Windows 10 Photo Viewer

shell
@echo off&cd\&color 0a&cls
echo Enable Windows 10 Photo Viewer
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".jpg" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".jpeg" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".bmp" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".png" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo Enabled Windows 10 Photo Viewer
pause

PowerShell

当前目录下的所有文件的创建时间和最后访问时间修改为修改时间

Get-ChildItem -File | ForEach-Object {$_.LastAccessTime = $_.CreationTime = $_.LastWriteTime}

当前目录下( 包含子目录)所有文件的创建时间和最后访问时间修改为修改时间

Get-ChildItem -File -Recurse | ForEach-Object {$_.LastAccessTime = $_.CreationTime = $_.LastWriteTime}