Here's the original code I saw on the page you linked:
@echo off setlocal enabledelayedexpansion cd /d "%~dp0\Date" call :getShortDate ren *.lnk %month%-%day%.lnk exit /b :getShortDate for /f "skip=1 tokens=1-3" %%A in ('wmic path Win32_LocalTime get day^,month^,year /value /format:table') do ( set day=00%%A set day=!day:~-2! set month=00%%B set month=!month:~-2! set year=%%C set year=!year:~-2! exit /b )
from this post, posted by and31415, edited by ArtofWarfare.
Add the year variable (already established in the batch file :getShortDate function) into the rename statement.
ren *.lnk %month% %day% %year% .lnk"
Also:
Powershell version (this replaces the whole batch file, OR you enter this as a scriptblock in a scheduled task, or use Powershell Jobs to schedule it as a job):
cd <path to link>; gci *.lnk | % { rename $_ "$(get-date -f "MM dd yy") .lnk" }