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.
retrieving DOS file date
Name: hammerdilk Date: February 7, 2005 at 12:00:25 Pacific OS: DOS CPU/Ram: Pentium 4 / 2 GB RAM
Comment:
How do I use simple DOS commands (trying to create a batch script) to get the date from a file in the directory? I have looked, and there does not appear to be any DOS commands that will retrieve this.
Name: dtech10 Date: February 7, 2005 at 14:14:55 Pacific
Reply:
Hi hammer What version DOS are you using and do you want the file date into a environment variable or just displayed on the screen.
0
Response Number 2
Name: hammerdilk Date: February 7, 2005 at 14:19:02 Pacific
Reply:
dtech10,
Thanks for the response...actually, it is Windows 2000, so DOS version 5.0. I would like to get this into a variable as I need to compare this to the current date so that we can determine if we have received a new version of the file or if our tasks are still processing off of an older version.
0
Response Number 3
Name: dtech10 Date: February 7, 2005 at 15:44:45 Pacific
Reply:
Hi hammer I not familar with Win2000 ,but this works in WinXP Pro.
@echo off dir program.ext | find /i "program.ext" > dir.txt for /f "tokens=1 delims= " %%a in (dir.txt) do set XDate="%%a
0
Response Number 4
Name: dtech10 Date: February 7, 2005 at 15:48:48 Pacific
Reply:
Hi XDate="%%a Just delete the "
0
Response Number 5
Name: Mechanix2Go Date: February 7, 2005 at 20:12:38 Pacific
Reply:
A quick cruise through:
for /?
shows that resolvong file to date/time is built in.
Summary: I need a batch file read a specific file date + time and compare it to my hardcoded date and time. If is a equal, another batch file will run and is not equal it will exit the batch file. I do this be...
Summary: Hey, I have almost no knowledge about programming and I have an old dos file that I need to "break" into. The company that made the software is of course out of business and I can't get the file to ru...
Summary: Actually, the OS is XP, but I'm writing in the command interpreter which comes with the XP opsys. So far the code is working fine, with the exception of the following..... I need to copy files dated t...