Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

touch

  • Thread starter Thread starter jsc
  • Start date Start date
Feb
2
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
 
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.
 
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.

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.
 
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!
 
Back
Top
[FOX] Ultimate Translator
Translate