Words to the wise – recreating Unix’s touch function in Windows
Creating an empty file.
type nul >> your_file.txt
copy /b filename.ext +,,
The following works through a set of files in a directory and refreshes the date of them. Useful if your company has a policy for deleting old files automatically, using Powershell.
(ls your-file-name-here).LastWriteTime = Get-Date
Get-ChildItem . * -recurse | ForEach-Object{$_.LastWriteTime = get-date}
https://docs.microsoft.com/en-us/sysinternals/downloads/file-and-disk-utilities
If you do this, it may be worth considering time stamping your files: textFile1_20180502.txt for example.
Posted: April 24th, 2018 under 42.