Hi ZoSTeRZoSTeR wrote: 2022-12-22, 10:02 UTC Here's the minimized version without confirmation using the Commander_Path environment variable:
Button:Script:Code: Select all
TOTALCMD#BAR#DATA powershell.exe -ExecutionPolicy remotesigned -Command "&{&"""$env:COMMANDER_PATH\Tools\PowerShell\Set-Date-of-Parent.ps1""" -FileList '%L'}" powershell.exe Set Date of Parent 1 -1
Code: Select all
Param( [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [string]$FileList ) $contentFileList = Get-Content -LiteralPath $FileList foreach ($filePath in $contentFileList) { if (Test-Path -LiteralPath $filePath -PathType Leaf) { $fileItem = Get-Item -LiteralPath $filePath $fileItem.CreationTime = $fileItem.Directory.CreationTime $fileItem.LastWriteTime = $fileItem.Directory.LastWriteTime } }
but could be work if i click on the folders and the scripts changed all the date of the files inside?
I mean select a bunch of folders (like 10 folders or more) with different creation date and let the script change all the date of the files inside according to the folders?
because seems the script does work only if i select the folder inside a folder
thank you so much