@echo off :: This batch file uses DEBUG to help determine :: the last accessed date of a file. Actually, :: you can determine the last access date with :: the "DIR /V" command. All this batch file does :: is extract the last accessed date from the :: response line. It turns out the date we want is :: always in the same character position on the line! :: Debug is used merely to strip away everything :: before the data we want and replace it with text :: that says "set accessed=". Debug is then used :: to set trim away everything after the data we want. if [%1]==[] goto HELP goto RUN :HELP cls echo You must supply a file name as an argument. goto DONE :RUN set accessed= dir /v %1 | find ":" | find "-" > ~setacc.bat > script echo f 100 l 3a 20 >> script echo e 12f "set accessed=" >> script echo rcx >> script echo 43 >> script echo w >> script echo q debug ~setacc.bat < script > nul del script call ~setacc.bat del ~setacc.bat echo Your file was accessed on %accessed% :DONE