Computing.Net > Forums > Disk Operating System > file's date

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

file's date

Reply to Message Icon

Name: grey
Date: February 17, 2003 at 07:57:02 Pacific
OS: MS-Dos 7.10
CPU/Ram: 1Ghz 116Mb
Comment:

how to put a file's date into a variable



Sponsored Link
Ads by Google

Response Number 1
Name: Miskva
Date: February 17, 2003 at 15:11:40 Pacific
Reply:

DOOOOM, get your script over here, quick !


0

Response Number 2
Name: tech-fred
Date: February 18, 2003 at 02:46:33 Pacific
Reply:

Secret Doom said he will be off until I think
the 23rd. Check some of the older posts. I
think he covered the same problem.


0

Response Number 3
Name: Secret_Doom
Date: February 18, 2003 at 09:23:52 Pacific
Reply:

I've found some time on my schedule to answer the un-answered batch questions. Here goes your solution, grey:

@echo off
if "%1"=="" goto eof
if not exist %1 goto eof
echo e115'SET %%1='> %temp%.\T1.DAT
echo e126 D A 1A>> %temp%.\T1.DAT
for %%? in (f100L15''20 w q) do echo %%?>> %temp%.\T1.DAT
dir/4 %1 |FIND ":" |FIND /v "\" > %temp%.\T2.BAT
DEBUG %temp%.\T2.BAT < %temp%.\T1.DAT > nul
call %temp%.\T2.BAT FDATE
for %%? in (T1.DAT T2.BAT) do del %temp%.\%%?
echo %1 was last modified on %FDATE%.
:eof

SINTAX: filename.bat filename.ext
(filename.bat is what you will name the batch file, and filename.ext is the file to get the date into variable).

You can use a hardcoded filename instead of %1, of course.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br

________________________________________________________


0

Response Number 4
Name: Secret_Doom
Date: February 18, 2003 at 09:24:53 Pacific
Reply:

By the way, good work you batch-people are doing around. =D

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: file's date

identifying a file by date www.computing.net/answers/dos/identifying-a-file-by-date/7098.html

file date in dos 4.1 www.computing.net/answers/dos/file-date-in-dos-41/12671.html

Deleting Files by Date?? www.computing.net/answers/dos/deleting-files-by-date/10700.html