2
I need to standardize the name of all the files in a folder, considering that the files already have a pattern at the beginning of their name up to the 8th character, being only necessary to demote everything in sequence. Example: currently "A200T011 - So-and-so of such.docx" -> as it should be "A200T011.docx".
Conditions: use script to run on Windows or Windows Server, may or may not be applied to a file. bat
I have already written a script that deletes the characters I do not want, but it is very expensive to list all the characters that should be deleted, it would be more interesting to do the opposite, informing a set of characters (few) and deleting everything that is not equal to this. Follow my script:
get-childitem | foreach {rename-item $_ $_.Name.Replace("E","")}
The above script replaces the 'E' letter with empty.
In case Voce wants to remove all caracertes from the files except the first 8 + extension.
– Ricardo Bohner