Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hueman domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/future4tech/public_html/wp-includes/functions.php on line 6114
TOUCH – Windows CMD Command - Future4Tech

TOUCH – Windows CMD Command

Chance file timestamps

Syntax
      TOUCH [option]... files ...

Key
   /t year month day hour minute second

This is a POSIX utility.
Use the optional argument /t to specify a date other than the current time.
( four-digit years, two-digit months, days, hours, minutes, seconds)

An alternative Touch using the COPY command

As first documented in the ancient (MSDOS) KB article Q69581 the COPY /b command can be used to touch the date/time of a file:

COPY /B Source.txt+,,Source.txt

This takes a source file, adds nothing (represented by the commas) and copies it to the same file as a destination. If you are working in a single folder, the second filename can be omitted as it will default to writing the same filename.

or as a batch file:
@Echo Off
COPY /B %1+,, %1

There are a few caveats with this technique:

It fails for read-only or hidden files. It may reset file permissions back to the default for the folder.

In some versions of Windows, if the file is 0 bytes long it will be deleted! If the file is a binary file with trailing null characters (0x00), they will be deleted, corrupting the file.

It is no longer a documented option in current versions of Windows. A better alternative is PowerShell, you can call a one-liner with powershell.exe

Example

To set the date to 7:30 am 1st October 2015

   TOUCH /t 2015 10 01 07 30 00 MyFile.txt

You may also like...

1 Response

  1. froleprotrem says:

    A lot of thanks for all of your labor on this website. Gloria enjoys going through investigations and it’s really simple to grasp why. Most people learn all relating to the lively ways you make invaluable suggestions via the web site and therefore improve contribution from the others on this concern while our favorite girl is in fact studying a lot. Take pleasure in the rest of the new year. You have been doing a first class job.

Leave a Reply

Your email address will not be published. Required fields are marked *


Notice: ob_end_flush(): Failed to send buffer of zlib output compression (0) in /home/future4tech/public_html/wp-includes/functions.php on line 5464