Changing the Date

I was asked by a friend the other day to help them to change the metadata on an NTFS file. I made sure that they were not trying to break any laws, and then I found this PowerShell cmdlet for them:

$(get-item ‘.\filename.ext’).CreationTime=$(Get-Date “04/28/2025”)

Of course, they were not very technical so I found a free tool that did it for her, but if you are reasonably comfortable around PowerShell and do not want to go downloading tools, this will do just fine.

There are a bunch of other attributes that you could change with this cmdlet by replacing CreationTime with options such as LastWriteTime or LastAccessTime… but that is not what was asked of me.

Please be aware that while this will work well for most cases, I do not promise that the original metadata could not be extracted using advanced forensic auditing. In other words, if you are trying to fool your professor into thinking you did not start writing your term paper the day before it was due, then you should be fine. If you are trying to fool law enforcement then I make no guarantees…

4 responses to “Changing the Date”

  1. Copilot gives a nice breakdown…

    The PowerShell cmdlet provided:$(get-item '.filename.ext').CreationTime = $(Get-Date "04/28/2025")

    does the following:

    get-item '.filename.ext': Retrieves the file object for filename.ext located in the current directory.

    $(...): Ensures the command inside is executed first and its result is used in the outer expression.

    .CreationTime = ...: Sets the CreationTime property of the file object.

    Get-Date "04/28/2025": Creates a DateTime object representing April 28, 2025.

    In summary: This command sets the creation time of the file filename.ext to April 28, 2025.

  2. Copilot provides a nice breakdown of your PS cmdlet for us non-PS experts…

    The PowerShell cmdlet provided: $(get-item '.filename.ext').CreationTime = $(Get-Date "04/28/2025")

    does the following:

    get-item '.filename.ext': Retrieves the file object for filename.ext located in the current directory.

    $(...): Ensures the command inside is executed first and its result is used in the outer expression.

    .CreationTime = ...: Sets the CreationTime property of the file object.

    Get-Date "04/28/2025": Creates a DateTime object representing April 28, 2025.

    In summary: This command sets the creation time of the file filename.ext to April 28, 2025.

    df

    1. Ah yes… but there was a time long ago when people would read my blog for answers, and not pick up their mouse and say ‘Hello Computer!’ 😉 Anyhow, thanks for reading 🙂

  3. Alas, it’s a whole new world… Glad you’re still providing intelligent and thoughtful advice. 🙂

Leave a reply to dave2u Cancel reply