1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

touch

Discussion in 'Support' started by jsc, Feb 28, 2012.

  1. jsc

    jsc

    Joined:
    Feb 28, 2012
    Messages:
    2
    Likes Received:
    0
    Hello,
    I want set the date of a file with:
    TOUCH /F /Dc7.5.1960 /Tc5:33:45 /Dw17.5.1961 /Tw15:03:45 "dateiname.txt"
    Unfortunately, it does not work. What the reason? It is not possible to set a date BEFORE 1970?

    Thanks for Your help.

    greeting from germany
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    That depends on the file system. NTFS allows dates from 1601, I think; FAT only allows dates from 1980.

    But I'm not at all sure that TOUCH supports changing two stamps at once. To set both the creation and the last-write stamp, you may have to call TOUCH twice.
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Neither TOUCH nor any other command supports referencing more than one type of timestamp in a single command. The only exception is date and time ranges, which could be a different time type than what is used elsewhere in the command. This is the way CMD.EXE works, and changing it has major issues with option specifications as well as command and response line lengths. OTOH it would occasionally be nice to have a report of more than one of the timestamps, ordering based on a different stamp than displayed, etc. But this is needed rarely enough that I would not request it.

    One can RETRIEVE more than one type of timestamp in a single command by using the @FILEDATE[] and / or @FILETIME[] function more than once in a single command, once for each type of timestamp to be retrieved.
     
  4. jsc

    jsc

    Joined:
    Feb 28, 2012
    Messages:
    2
    Likes Received:
    0
    Yes, that is it: You can not twice /Dx in one commandline.
    TOUCH /F /Dw17.5.1960 /Tw15:03:45 "dateiname.txt" and
    TOUCH /F /Dc17.5.1960 /Tc15:03:45 "dateiname.txt"
    makes it.

    Thanks!
     

Share This Page