Update file date windows

Update file or folder Date Modified

I need to update the «Date Modified» property of files and folders as they are copied from one location to the other so that «Date Modified» = Current System Time. I have a PC with Windows 7, and I do NOT have administrative rights on it, so I can’t install any custom utilities. My current bat file uses XCOPY:

On my Windows XP box I use the «touch» command from UnxUtils, but I can’t find an equivalent that’s native to Windows 7. Thank you!

4 Answers 4

There is a very simple (though arcane) syntax to «touch» a file on Windows. (update the last modified timestamp)

If the file is in the current directory, all you need is:

If the file is in some other path, then this works:

However, it seems like you still would have a lot of coding to do, since I believe you only want to touch files that are copied.

The following is untested, though I believe it will work. I can’t vouch for the performance. This solution requires 2 unused drive letters. I’m assuming K: and L: are available.

You could use powershell , which I believe is already installed on Windows 7 by default. Add this line to your batch file to run a powershell command that updates the timestamp on all files named Abandoned_Wire*.*:

What that line is doing is simply:

-command : tells powershell to run the following command and return immediately

ls : list all matching files at the path specified

foreach-object : run the following block on each file that ls found

$_.LastWriteTime = Get-Date : for each file, set the LastWriteTime to the value returned by Get-Date (today’s date and time)

How do I modify file date created?

Is there an easy way to modify file date created without outside software?

Replies (6) 

You can modify the date created by copying a file. The file’s created date becomes the modified date and the current date (when the file is copied) becomes the created date. You can copy a file on your PC to check.

Let us know if you need further assistance.

10 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for the quick reply.

Yes that would work, but I want to change it to a specific date.

Is there any command like the touch -d command in Linux?

6 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

We appreciate your response. The easiest way for you to modify the files to a specific date is by using a 3rd party application that you can search in Windows Store. Or you can also post a feedback about your query using the Feedback Hub, which is readily available in Windows 10.

Читайте также:  Отличие линукс от астра линукс

2 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I use the third party utility SKTimeStamp — Stefan’s Tools and it works very well for what you want. It adds a tab to the file’s Properties so it is easy to use — where you can see the existing entries below you can just overwrite them with the dates-times that you want.

You could use the built-in capabilities of Powershell to do this job but you would have to work out a user interface to suit your needs. SKTimeStamp covers that already.

56 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How to Change the Last Modified Date, Creation Date, and Last Accessed Date for Files and Folders

A combination of built-in and third-party tools will do the trick

Every file you create or modify on Windows 10 has file attributes attached to it, telling you (or somebody else) when the file was created, modified, opened, and possibly more. It doesn’t matter if you’re late submitting an assignment or you’re just trying to cover your tracks—the information will always be there unless you change it.

If you want to change file attributes like these, you have a few options. You can use the new Windows PowerShell to change or remove this data, or you can do it using Windows File Explorer or another third-party app like Attribute Changer. Here’s how to change file attributes on Windows 10 using these methods.

Removing File Attributes Using Windows File Explorer

If you want to change the last modified date or other file attributes on Windows 10, your first thought may be to do so using the Properties menu for a file in Windows File Explorer.

Unfortunately, this isn’t possible. You can view certain and change certain file attributes in File Explorer, but you can’t change the last viewed, edited, or modified dates. It will remove other personal data, however, such as author name for documents, ratings for media files, as well as set a file to read-only or hidden.

To change other file attributes like your last modified date, creation date, and other essential file information, you’ll need to use one of the methods listed later in this article—in particular, using the Attribute Changer app.

  • To remove certain personal file attributes, open Windows File Explorer and locate a file. Right-click the file and press Properties.

  • In the Properties box, press the Details tab, then click the Remove Properties and Personal Information option link.
  • As we’ve mentioned, you can’t remove or change the file creation date or other essential file attributes here. If your file has other personal information attached, you can create a copy of the file with that information removed by pressing the Create a copy with all possible properties removed option, then press OK to save and perform the action. A copy of your file will appear in the same folder as the original file with your chosen attributes removed.
Читайте также:  Chicken invaders для windows

  • To remove this information from an existing file, select the Remove the following properties from this option instead, then choose the properties you want to remove. Press OK to save and remove this information from your file.

  • You can also use File Explorer to change or set other file attributes, such as whether your files are hidden or read-only. In the Properties box, switch to the General tab, then press either the Hidden or Read Only checkboxes to enable or disable those settings, then click OK to save.

To change the last modified date and other attributes, you’ll need to use another method listed below.

Change File Attributes Using The PowerShell

The attrib command from the Windows PowerShell allows you to view and change file attributes for Windows 10 files. It’s included as standard, so you don’t need any additional software to use it.

This is a fairly complex method, but also quite limited. If you want an easier way to change file attributes, use the Attribute Changer app listed below.

  • To start, open a PowerShell window—preferably with administrative privileges. To do this, right-click the Windows start menu and press PowerShell (Admin) to launch a new PowerShell window with admin privileges enabled.

  • Use the cd and ls commands to move folders and list file contents. Once you’re in the correct folder, you can list all the relevant attributes for your file by typing Get-ItemProperty -Path file | Format-list -Property * -Force, replacing file with your file path.

  • You can use the Set-ItemProperty command to change file attributes such as read-only access. To do this, type Set-ItemProperty -Path file -Name IsReadOnly -Value True, replacing file with your file name. For a full list of possible variables for this command, see the full Microsoft PowerShell documentation for more details.

A successful change will result in the PowerShell returning no response, but you can check whether it was successful by typing the Get-ItemProperty -Path file | Format-list -Property * -Force command again, or by viewing the file properties using File Explorer.

This isn’t the easiest method to change file attributes, as we’ve mentioned. Third-party apps like Attribute Changer exist to make this far easier, as well as allowing you to change the last modified date and more.

Using Attribute Changer To Change Windows 10 File Attributes

Attribute Changer offers the best way to change file attributes on Windows. Along with typical hidden and read-only attributes, Attribute Changer allows you to modify file access and file creation dates, as well as other options.

  • You’ll need to download and install Attribute Changer first. Once installed, open Windows File Explorer and locate a file, then right-click and press the Change Attributes option.

  • An advanced properties box for your file will open—this is the Attribute Changer software in action. Check (or uncheck) to enable or disable various system attributes like hidden file or read-only access at the top of the File Properties tab.

  • If you want to change the last modified date or change the file creation data, press to enable the Modify date and time stamps checkbox. This will enable you to change the created, modified, and accessed timestamps—change these using the options provided.

  • Once you’ve made your changes, press the OK or Apply buttons. Attribute Changer will ask you to confirm the changes, so press the additional OK button in the Processing Confirmation box that appears.
Читайте также:  Как отключить автообновление chrome mac os

Attribute Changer will switch to the Reporting tab and, assuming no issues, will list the progress of the changes and apply the changes you’ve requested. You can double-check this by right-clicking your file, pressing Properties, and viewing your file attributes in the General and Details tabs.

File Management On Windows

As the above methods show, there are plenty of ways to change file attributes on Windows 10 and which will, hopefully, get you into the habit of better file management on Windows. You could start by switching to a replacement for Windows Explorer to make it easier to sort and manage your files.

If you’re worried about losing your files, don’t worry—you can prevent Windows files from being deleted, too. Let us know your tips for file management in the comments section below.

Ben Stockton is a freelance technology writer based in the United Kingdom. In a past life, Ben was a college lecturer in the UK, training teens and adults. Since leaving the classroom, Ben has taken his teaching experience and applied it to writing tech how-to guides and tutorials, specialising in Linux, Windows, and Android. He has a degree in History and a postgraduate qualification in Computing. Read Ben’s Full Bio

Rules for “Date Modified” of folders in Windows Explorer

How does Windows Explorer determine the «Date Modified» field for folders? [Aside: I know this is asking from an explorer-specific perspective, but the behaviour could be useful to coding search/sort type activities]

Is there a definitive description of this anywhere — searches of Microsoft, MSDN, Google & Stack Overflow have been unsuccessful.

Personal experiments seem to suggest that in a tree of folders:

  1. when a folder/file is added/deleted in a folder, the containing folder’s date modified is updated.
  2. when the content of a file is modified, the containing folder is unaffected

However, I’m looking at some directories that don’t seem to conform to these basic rules — running down the tree I have (dates in DD/MM/YYYY format):

60s delay. House of (sch)ticks on silicon. – crokusek Aug 3 ’17 at 19:05

2 Answers 2

This is not explorer specific, this is NTFS-related.

Note: Modified time can be disabled with filesystem option, so you should never rely on it. Any suggested reliable methods would be appreciated.

Disclaimer: I tested all of these myself on Windows 10. I could not find an authoritative source documenting all of these behaviours. It is entirely possible that I made a mistake somewhere.

The folder’s last modified time is updated for these actions:

  • new file or folder directly in target folder
  • renamed file or folder directly in target folder
  • deleted file or folder directly in target folder
  • hardlink create/delete/rename — same as files
  • file/folder symlink create/delete/rename
  • directory junction create/delete/rename

It is not updated for these actions:

  • modified contents of file directly in target folder
  • edit target of symlink or junction contained in target folder
  • file’s or sub-folder’s created/modified date changing
  • edit basic attributes (hidden/archive/system) of a direct child
  • NTFS compression/encryption change of a direct child
  • anything at all happening in a sub-folder — literally anything
  • changing attributes of the folder itself
  • changing owner/ACL of the folder itself
  • owner or ACL of a direct child changing
  • if the folder is a directory junction, changing the target
  • adding/deleting alt data streams to a direct child file
Оцените статью