generalnewbie Posted November 7, 2006 Share Posted November 7, 2006 I have a folder with filenames and they all have the prefix named DDRM-filename1.doc DDRM-filename2.doc DDRM-filename3.doc DDRM-filename4.doc There has to be like 50 files and i just would like the DDRM part remove cause its annoying and i figured there was a easier way then file rename each and every file. Is there a way to scan a directory and change it with a bat or vbs file? Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/ Share on other sites More sharing options...
0 Doli Posted November 7, 2006 Share Posted November 7, 2006 generalnewbie said: I have a folder with filenames and they all have the prefix named DDRM-filename1.doc DDRM-filename2.doc DDRM-filename3.doc DDRM-filename4.doc There has to be like 50 files and i just would like the DDRM part remove cause its annoying and i figured there was a easier way then file rename each and every file. Is there a way to scan a directory and change it with a bat or vbs file? You can do this in Windows if you highlight all the files and right click-> rename. You will rename only one file (make sure its the top DDRM-filename1 file you right click) and the other will follow. You might not like the results because it will turn out like: filename.doc filename(1).doc filename(2).doc filename(3).doc ... ... ... Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023550 Share on other sites More sharing options...
0 jake1eye Posted November 7, 2006 Share Posted November 7, 2006 Place this VBS Script in the folder that you want to change the names. Save As ReName.vbs Quote Const OverwriteExisting = True Dim File, Folder, StrF, StrT Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject") '/-> Set The Folder Path Set Folder = Fso.GetFolder(Fso.GetParentFolderName(WScript.ScriptFullName)) '/-> Object For Collection Set File = Folder.Files For Each StrF In File '/-> DDRM-filename1.doc Change This DDRM To Match What You Want To Filter If InStr(StrF.Name,"DDRMen StrT = Replace(StrF.Path, "DDRM-", "") Fso.CopyFile(StrF.Path), (StrT),OverwriteExisting Fso.DeleteFile(StrF.Path),True End If Next Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023674 Share on other sites More sharing options...
0 AdverseDeviant Posted November 7, 2006 Share Posted November 7, 2006 Bulk Rename Utility Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023688 Share on other sites More sharing options...
0 Suren Posted November 7, 2006 Share Posted November 7, 2006 backup your data before you try anything! Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023689 Share on other sites More sharing options...
0 generalnewbie Posted November 7, 2006 Author Share Posted November 7, 2006 umm that script jake1eye deleted the files ahhahaha!!!!! and i cant get them back! Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023692 Share on other sites More sharing options...
0 chroniX Posted November 7, 2006 Share Posted November 7, 2006 Suren said: backup your data before you try anything! generalnewbie said: umm that script jake1eye deleted the files ahhahaha!!!!! and i cant get them back! Lol...should have took Suren's advice. Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023705 Share on other sites More sharing options...
0 Starchild Posted November 7, 2006 Share Posted November 7, 2006 THE rename :yes: Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023721 Share on other sites More sharing options...
0 mrvc Posted November 7, 2006 Share Posted November 7, 2006 Rname-it Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023790 Share on other sites More sharing options...
0 RichardK Posted November 7, 2006 Share Posted November 7, 2006 http://www.bulkrenameutility.co.uk Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023802 Share on other sites More sharing options...
0 jake1eye Posted November 7, 2006 Share Posted November 7, 2006 generalnewbie said: umm that script jake1eye deleted the files ahhahaha!!!!! and i cant get them back! It ment to delete the original file names, it does not delete the rename file, I guess you did not know that. Link to comment https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/#findComment-588023883 Share on other sites More sharing options...
Question
generalnewbie
I have a folder with filenames and they all have the prefix named
DDRM-filename1.doc
DDRM-filename2.doc
DDRM-filename3.doc
DDRM-filename4.doc
There has to be like 50 files and i just would like the DDRM part remove cause its annoying and
i figured there was a easier way then file rename each and every file. Is there a way to scan
a directory and change it with a bat or vbs file?
Link to comment
https://www.neowin.net/forum/topic/510028-easy-way-to-remove-prefix-to-file-names/Share on other sites
10 answers to this question
Recommended Posts