I need to update the \"Date Modified\" property of files and folders as they are copied from one location to the other so that \"Date Modified\" = Current System Time. I ha
You could use powershell
, which I believe is already installed on Windows 7 by default. Add this line to your batch file to run a powershell command that updates the timestamp on all files named Abandoned_Wire*.*:
powershell.exe -command "ls 'folder\Abandoned_Wire\*.*' | foreach-object { $_.LastWriteTime = Get-Date }"
What that line is doing is simply:
-command
: tells powershell to run the following command and return immediately
ls
: list all matching files at the path specified
foreach-object
: run the following block on each file that ls
found
$_.LastWriteTime = Get-Date
: for each file, set the LastWriteTime
to the value returned by Get-Date
(today's date and time)