Here's the Powershell command if anyone's interested.
$scriptDir = Join-Path
$env:USERPROFILE "Documents\WindowsScripts"
New-Item -ItemType Directory -Force -Path
$scriptDir | Out-Null
$scriptPath = Join-Path
$scriptDir "Add-Timestamp-To-AnyItem.ps1"
@'
param(
[Parameter(Mandatory=$true)]
[string]$Path
)
if (-not (Test-Path -LiteralPath
$Path)) {
exit 1
}
$item = Get-Item -LiteralPath
$Path
$stamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
if ($item.PSIsContainer) {
$newName = "{0}_{1}" -f
$item.Name,
$stamp
} else {
$newName = "{0}_{1}{2}" -f
$item.BaseName,
$stamp,
$item.Extension
}
$newPath = Join-Path
$item.DirectoryName
$newName
$counter = 1
while (Test-Path -LiteralPath
$newPath) {
if ($item.PSIsContainer) {
$newName = "{0}_{1}_{2}" -f
$item.Name,
$stamp,
$counter
} else {
$newName = "{0}_{1}_{2}{3}" -f
$item.BaseName,
$stamp,
$counter,
$item.Extension
}
$newPath = Join-Path
$item.DirectoryName
$newName
$counter
}
Rename-Item -LiteralPath
$item.FullName -NewName
$newName
'@ | Set-Content -Encoding UTF8 -Path
$scriptPath
$menuKey = "HKCU:\Software\Classes\AllFilesystemObjects\shell\AddTimestamp"
$commandKey = "$menuKey\command"
New-Item -Force -Path
$menuKey | Out-Null
New-Item -Force -Path
$commandKey | Out-Null
Set-ItemProperty -Path
$menuKey -Name "MUIVerb" -Value "Add timestamp"
Set-ItemProperty -Path
$menuKey -Name "Icon" -Value "shell32.dll,-46"
New-ItemProperty -Path
$menuKey -Name "Extended" -Value "" -PropertyType String -Force | Out-Null
Set-ItemProperty -Path
$commandKey -Name "(default)" -Value "powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"$scriptPath`" `"%1`""
› Use Shift Right-click any file or folder > Add timestamp" then voila!