Page 1 of 1

change extension without previously selected files

Posted: 02 Feb 2025 15:16
by atisoro
Is it possible to change the extension for all .txt files in a folder without selecting them manually?

in folder:
...\Test\fileA.txt
...\Test\file new.txt
...\Test\another file.txt

by code in
...\Test\fileA.rtf
...\Test\file new.rtf
...\Test\another file.rtf

?

Re: change extension without previously selected files

Posted: 02 Feb 2025 15:50
by highend
As long as you're in the same path:

Code: Select all

$srcExt = "txt";
    $dstExt = "rtf";

    rename "e", $dstExt, , listfolder(, "*.$srcExt", 1), 64;

Re: change extension without previously selected files

Posted: 02 Feb 2025 15:59
by atisoro
highend: brilliant, like always.
I couldn't finish them.
:beer: