Results 1 to 13 of 13

Thread: MS-DOS

  1. #1
    New Lounger
    Join Date
    Aug 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MS-DOS

    How do I extract the date information (using a DOS sentence) of a file in DOS??

    I need to use that command in a .bat file and compare to today

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS-DOS

    Hello! I've just been pointed at your post!

    Do you really mean MS-DOS, if so, which version?

    Or do you mean the Command Prompt window of something like XP?

    The answer would depend on which version you have, since the newer versions have more power to do what you want.

    Let me know, and I'll have a bash...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS-DOS

    It depends on what version of DOS you have. The batch code in the attached file should do what you asked for versions of DOS before the version that came with Windows NT. It may or may not work on later versions.
    Legare Coleman

  4. #4
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS-DOS

    Legare

    If the OP has Windows XP your BATch file could be optimised significantly!

    I'll wait for a response...

    John

    PS There are also the usual problems with the format of dates, dependent on the Regional/International Settings. Many of these BATch files blithely assume that the whole universe works with mm/dd/yy format!
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  5. #5
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,579
    Thanks
    5
    Thanked 1,057 Times in 926 Posts

    Re: MS-DOS

    John,

    It doesn't all work with mm/dd/yy????? <img src=/S/confused3.gif border=0 alt=confused3 width=45 height=45> What is wrong with the majority of the known world?? <img src=/S/disappointed.gif border=0 alt=disappointed width=15 height=15> <img src=/S/anigrin.gif border=0 alt=anigrin width=19 height=19>

    Joe
    Joe

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: MS-DOS

    > What is wrong with the majority of the known world??
    It just never seemed right to put the least significant digit in the middle of a numerical value to the rest of us.

    StuartR

  7. #7
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS-DOS

    It makes as much sense as putting the most significant digits last! <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15> <img src=/S/bow.gif border=0 alt=bow width=15 height=15>
    Legare Coleman

  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS-DOS

    I can see that the countries which use
    yyyy mm dd hr mn sc
    are going to have to sort you out!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #9
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS-DOS

    <img src=/S/yep.gif border=0 alt=yep width=15 height=15>
    Legare Coleman

  10. #10
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Juneau, Alaska, USA
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS-DOS

    I've got to admit that I've never understood why all countries that I know of use the 'proper' format for time (hr mn sc) but not for dates.

    By the way, I prefer to avoid the numeric representation of months when dealing with people. I haven't encountered a lot of confusion over which month is meant, but whenever I have encountered it it's always been due to the use of numbers. I have yet to encounter someone (English-speaking) who doesn't understand what month I mean, without even thinking about it, when I say 'September'.

  11. #11
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MS-DOS

    We're in deep water even with time, because there is the 24-hour "military" time vs. the 12 hour AM/PM version, plus innumerable variations of whether hours are always two digits, or don't have leading zeros, and so forth.

    I spent a couple of happy days documenting all the forms of date and time for the 90-odd regional settings in NT4, W2K and WXP -- and if you're not careful I'll tell you all the details!!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  12. #12
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,579
    Thanks
    5
    Thanked 1,057 Times in 926 Posts

    Re: MS-DOS

    <img src=/S/hailpraise.gif border=0 alt=hailpraise width=27 height=22> For having the fortitude to do that in the first place. But please don't joke (you were joking right?? <img src=/S/RollEyes.gif border=0 alt=RollEyes width=19 height=19>) about subjecting another living being to that level of excitement <img src=/S/yikes.gif border=0 alt=yikes width=15 height=15> <img src=/S/surrender.gif border=0 alt=surrender width=31 height=23>

    Joe
    Joe

  13. #13
    New Lounger
    Join Date
    Aug 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS-DOS

    JOHN,

    thanks a lot!! YOUR answer actually worked wonderfully

    (((sorry everybody else got worthlessly in the day/time format discussion ... <img src=/S/argue.gif border=0 alt=argue width=50 height=25> )))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •