![]() This will rename parts of all the files in the current folder. However, got errors like rename-item : Source and destination path must be different until I changed it a bit.ĭir | Where-Object The PowerShell way works for me and easier to understand and change. If you're willing to go through that trouble, I'd suggest you use WindowsPowerShell (or Cygwin) at least (for your own sake) or install a more advanced scripting language (think Python/Perl) you'll get more support either way. ![]() , wrap it in a goto thing and make it work. ![]() ![]() IF you want to assume you don't know the positions of the _ and the lengths and the extension, I think you could do something with for loops to check the index of the _, then the last index of the. I just came up with this script, and I did not test it. If you don't it might be more complex than a simple substring. I am assuming you know the length of the part before the _ and after the underscore, as well as the extension. If a file is named "part1_part2_part3.jpg", then it will be renamed to "part2_part3_part1.jpg"Īs Itsproinc said, the REN command works!īut if your file path/name has spaces, use quotes " "Įxample: ren C:\Users\
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |