![]() ExecutionPolicy ByPass allows you to run PowerShell without needing to modify the global policy, which is there to prevent people accidentally running scripts. A Better Finder Rename is the most powerful and complete Mac file renaming application on the market. %~1 is the path of the file dropped onto the batch without quotes.ĬHCP 65001 > nul sets characters to UTF-8 and swallows the output. %~dp0 is the current directory of the batch file. A Better Finder Attributes Core features:-batch change file creation date and time-batch change file modification date and time-batch adjust the Exchangeable. I think the PowerShell is readable, so will just explain the batch speak: Then here is example usage within my 'CONVERT.BAT' batch file: %~dp0\ffmpeg -i "%~1" ACTION "%~1-output.mp4"ĬHCP 65001 > nul & PowerShell -ExecutionPolicy ByPass -File "%~dp0\CLONE-FILE-DATE.PS1" "%~1" "%~1-output.mp4" (GI -LiteralPath $TargetPath).LastWriteTime = (GI -LiteralPath $SourcePath).LastWriteTime ![]() (GI -LiteralPath $TargetPath).CreationTime = (GI -LiteralPath $SourcePath).CreationTime Owners of earlier versions need to purchase an upgrade to version 11. owners of the Rename product or the tool series who purchased their product after January 1st, 2019. My solution was make the 'touch' part a seperate PowerShell script which I called 'CLONE-FILE-DATE.ps1' and it contains: param Version 11 of A Better Finder Rename is free for: owners of a forever upgrade of the Rename product or the tool series. This seemed simple at first until you find batch files are terrible at handling unicode file names, in-line PowerShell messes up with file name symbols, and double escaping them is a nightmare. So 'drag and drop' video file on to batch file, FFMPEG runs, then 'Date Created' and 'Date Modified' from the input file gets copied to the output file. I wanted the 'touch' feature of cloning / duplicating the file dates from another file, natively, and be usable from a batch file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |