How would I rename a string in all file types not just one file type like .txt
in Windows 10? Like for example if all my file names were named Bear-(number) but there are lots of different file types like .html, .php, .pdf, .css, & more
how could I rename them all? I don't want to have to list all the file types in the folder... Your help would be appreciated.
Asked
Active
Viewed 311 times
-1

mkrieger1
- 19,194
- 5
- 54
- 65
-
Have you tried using Notepad++ ? You can do a find and replace in multiple files by wildcard match – Jay Dec 09 '16 at 09:01
-
@Jay Notepad++ only renames strings in files not renaming the file itself... – Maria Parise Dec 09 '16 at 09:02
-
Just to clarify (because it is hard to deduce from the wording of your question...) Do you mean you want to change a whole bunch of file names with different extensions rather than change a string in a file? – Jay Dec 09 '16 at 09:04
-
Use command line then - `rename Bear-{number}.* Bear-{differentNumber}.*` – Jay Dec 09 '16 at 09:07
-
@Jay Command Prompt? – Maria Parise Dec 09 '16 at 09:08
-
Yes - I'll add an answer, hang on – Jay Dec 09 '16 at 09:08
-
@Jay If I use this code how it know the directory/folder?? – Maria Parise Dec 09 '16 at 09:09
1 Answers
1
In windows 10, use command prompt by clicking on the windows button and typing in cmd
Switch to the directroy you have your files in - for example if they are in a directory called 'temp' enter cd temp
.
Another example - if the files are in a nested folder like c:\temp\test - enter cd c:\temp\test
If they are on another drive, you will need to change to that drive by specifying the drive letter and then a colon... eg 'e:'
rename all files rename Bear-00001.* Bear-00002.*
The * at the end will preserve the file extension while changing the file name itself
hth

Jay
- 9,561
- 7
- 51
- 72
-
-
Just to add some information, if your files have different names, you can do : `rename *.* theNewFilesNames.*` – dtlvd Dec 09 '16 at 09:15
-
Nope didn't work... Got this `The system cannot find the file specified.` – Maria Parise Dec 09 '16 at 09:15
-
Can you let me know the filename of one of the files you want to rename and also the command you have typed into command prompt? – Jay Dec 09 '16 at 09:17
-
I see the problem. It's cause that's not the name of the file so it says that... I need it to rename all files with this word in it is what I meant. Like for example if there was 100+ files with 83974- in the file name – Maria Parise Dec 09 '16 at 09:19
-
Only thing is it didn't rename the files in the sub-folders and didn't rename the folders -_- – Maria Parise Dec 09 '16 at 09:25
-
Great, glad to have helped. This command can be made to work for sub-folders, but you need to know a bit about batch scripting for that... – Jay Dec 09 '16 at 09:29
-
See http://stackoverflow.com/a/15317773/685341 - it's a bit more advanced, but should work if you want to go down that route – Jay Dec 09 '16 at 09:30