Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have found out if you type dir /v in DOS it gives you more info. The last accessed and modified date of a filename. I want to alter the modified date from DOS. Is it possible? and i not bothered how i can do it. Is there any DOS utils or seach file finders that can do it. Anything?

I have found this but i using Win98 disk and can't get find to work on that.
@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%

i make it clearer how can i get the 'last accessed time' in DOS of a filename. the time displayed in DOS is usually the modified time.
doing dir /V and using the batch above but is there an easier way with a util or an easier batch withoud the find command as i don't have.

A file's modified date should be the date that shows with the DIR command. DIR/O:D in the directory containing the files will sort them by date and time.
To change the date and/or time I've always used Norton Utilities. I think the NU file name is FD.exe and at least in the dos version I use, it needs to be run from pure dos.

DIR/O:A/V sorts them by 'last accessed'.
You can check the DIR switches by typing DIR/? at the dos prompt.

i can change the modified date fine with lots of tools. i need to retrieve the last accessed time. this is only shown up doing dir /v. all the tools out there seem to change the modified date.
dir/o only lists them in the order. i ust need to get the date of one file not a list of files.

If you want the last accessed date of a particular file then:
DIR/V file name
The batch file you listed in your first response works too. You don't need to use the FIND command separately. Either I don't understand what you want or you're doing something wrong.

Oh, the batch file uses the find command and you don't have the find command or for some reason don't want the batch file to use it??

![]() |
Small crars on the screen...
|
parking HD
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |