5

I have a bunch of files downloaded, and I downloaded them in chronological order how they are meant to be accessed from another source.

Because of an error, one file somewhere in the middle wasn't downloaded, and I have to download it manually later.

Is it possible for me to edit the "date" that windows shows (aka when I downloaded the file), so that, when I sort by date, the files would be in the right order again?

1

2 Answers 2

6

Yes, you can do this with PowerShell natively on Windows without using any third party tools using Set-ItemProperty as I'll show you in an example below.

You only need to plug in the date and time stamp value which you want the file attribute(s) to match, and run to get those updated to reflect within Windows File Explorer.

You will likely only need to update the LastWriteTime attribute to reflect the correct value you see within Windows File Explorer but I've also included the CreationTime and LastAccessTime too.

PowerShell Commands

Note: Just set the $Dt variable value to be the yyyy-MM-dd hh:mm:ss tt value you want the file attributes to be and run to have those changed. Also set the $srcfile to be the full path of the file.

$Dt = "2099-01-07 01:19:17 PM"
$newDate = [datetime]$Dt
$srcfile = "C:\Folder\File.png"

Set-ItemProperty -Path $srcfile -Name CreationTime -Value   $newDate
Set-ItemProperty -Path $srcfile -Name LastWriteTime -Value  $newDate
Set-ItemProperty -Path $srcfile -Name LastAccessTime -Value $newDate

Further Resources

2
  • 1
    worked as expected, just had to change the lastwritetime, thanks! Commented Jan 7, 2021 at 11:14
  • For what it's worth, this works perfectly fine with relative paths too.
    – Shadow
    Commented Aug 2, 2023 at 2:38
0

Changing file attributes is not natively part of Windows Explorer options.

Preferable: I change filenames (part of) to organize downloaded or saved files in a "proper" order (for me). This is the best way to solve this issue. I have hundreds of files properly organized this way and without having to resort to specialized tools.

Alternate: However, you can use Power Shell, or download a small attribute changer to change file dates as you need.

See Change File Attributes

(A) 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.

(B) 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .