+5 votes
665 views
Change file or folder creation date with PowerShell

in Windows 10 by (552k points)
reopened | 665 views

1 Answer

+3 votes
Best answer

1. Change file creation date within a Windows 10 folder with PowerShell
2. Change concrete file creation date in Windows 10 with PowerShell
2. Change concrete folder creation date in Windows 10 with PowerShell

One of the most useful tools of Windows operating systems is PowerShell which is slowly becoming the ideal solution for the entire console work theme thanks to its various cmdlets that help us optimize many tasks in the system..

One of these tasks, which few we knew, is to change the date of creation of a file or folder and this is useful in administration, audit or similar tasks, event management, etc.

Today we will see how to perform this process in a practical way with Windows PowerShell..

To keep up, remember to subscribe to our YouTube channel! SUBSCRIBE


1. Change file creation date within a Windows 10 folder with PowerShell


The first option we will see is to change the creation date of all files within the selected folder.
Step 1

We have the following files: image
Step 2

As we can see, they have a creation date on January 30, 2018. If you do not see the creation date, we go to the “View / Add columns” menu and there select “Creation Date”: image
Step 3

To change the date of all files, we will execute the following in PowerShell:
 Get-ChildItem D: \ Tests \ TechnoWikis | % {$ _. CreationTime = '12 / 12/2017 10:00 '} 
Step 4

With this script we will define the path where the files to be edited are located and with the “CreationTime” variable we set the month, day and year to be assigned. We will run this in PowerShell as administrators: image
Step 5

We refresh the destination folder and we can see that the date has been edited: image

2. Change concrete file creation date in Windows 10 with PowerShell

Step 1

The next alternative we have is to edit the creation date of a particular file using PowerShell, in this example we will edit the file called TechnoWikis to the desired date and for this we execute the following:
 Get-ChildItem D: \ Tests \ TechnoWikis \ TechnoWikis.txt | % {$ _. CreationTime = '01 / 01/2018 10:30:40 '} 
Step 2

In this case we have defined that this particular file has the creation date on January 1, 2018 at 10:30 am: image
Step 3

We can see the change in the selected file: image

2. Change concrete folder creation date in Windows 10 with PowerShell

Step 1

Finally, if we want to change the creation date of the folder that contains the files we will execute the following, first we validate the creation date of the folder: image
Step 2

Now we execute the following:
 Get-Item D: \ Tests \ TechnoWikis | % {$ _. CreationTime = '10 / 01/2018 09:00:00 '} 
image
Step 3

We will see the respective change: image

We see how simple it is to perform this task in Windows PowerShell.


by (3.5m points)
edited

Related questions

+5 votes
1 answer
asked Oct 16, 2019 in Linux / Unix by backtothefuture (552k points) | 277 views
+5 votes
1 answer
asked Nov 13, 2019 in Windows 10 by backtothefuture (552k points) | 1.1k views
+4 votes
1 answer
+3 votes
1 answer
asked Sep 16, 2019 in Windows 10 by backtothefuture (552k points) | 352 views
+4 votes
1 answer
asked Nov 2, 2019 in Windows 10 by backtothefuture (552k points) | 303 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users