Say I have 1000 rtf o mp3 files and I want to change the date modified of them all to the current time. How can I do that?
Asked
Active
Viewed 156 times
0
-
Related: https://superuser.com/questions/10426/windows-equivalent-of-the-linux-command-touch/764721#764721 – Reddy Lutonadio Nov 26 '19 at 11:43
-
@ReddyLutonadio Thanks. Is there any difference between "copy /b *.* +,, " which seems to work fine and all the other solutions there? – OMGsh Nov 27 '19 at 08:16
-
There are all meant to work. The only difference (if I can call it difference) is which tool is more comfortable to work with or easier for you to implement. – Reddy Lutonadio Nov 27 '19 at 08:58
1 Answers
0
Put all the of items you want changing in 1 folder, go to the directory before the folder and run this.
foreach($file in Get-ChildItem **FolderName**) {$(Get-Item $file.Fullname).lastwritetime=$(Get-Date)}
SQLTemp
- 1,452
- 2
- 10
- 22
-
1Welcome to Super User! Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others. Could you explain your code? – MMM Nov 26 '19 at 11:48