MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
September
Sun Mon Tue Wed Thu Fri Sat
   
8
     
2015
Months
Sep


Tue, Sep 08, 2015 8:04 pm

Changing the time stamp on a file or directory under Windows

On a Microsoft Windows system, files and directories have three time stamps associated with them: the creation time for the file or directory, the time it was last modified, and the time it was last accessed. If you wish to change any of those time stamps, you can use a utility such as the free NirCmd utility provided by Nir Sofer at NirSoft. E.g., you can change the date/time of the specified filename (creation time and modified time) using a command such as the one below:

nircmd.exe setfiletime "c:\temp\myfile.txt" "24-06-2003 17:57:11" "22-11-2005 10:21:56"

Nir also provides FolderTimeUpdate, which "scans all files and folders under the base folder you choose, and updates the 'Modified Time' of every folder according the latest modified time of the files stored in it. This tool might be useful if, for example, you backup a cluster of folders and then restore them into another disk, but the backup program doesn't restore the original modified time of the folders."

You can also use Windows PowerShell, which Microsoft has made available for Windows XP and later versions of its operating system to change those time stamps using a command similar to the following ones where name is the file or directory name for which you wish to change the time stamp:

$(Get-Item name).creationtime=$(Get-Date "mm/dd/yyyy hh:mm am/pm")
$(Get-Item name).lastaccesstime=$(Get-Date "mm/dd/yyyy hh:mm am/pm")
$(Get-Item name).lastwritetime=$(Get-Date "mm/dd/yyyy hh:mm am/pm")

[ More Info ]

[/os/windows/PowerShell] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo