• 0

easy way to remove prefix to file names?


Question

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?

10 answers to this question

Recommended Posts

  • 0
  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

...

...

...

  • 0

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
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • >For instance, if you are watching a tutorial, you could ask for a summary or even for a quiz on the main points. At that point, the content creator should get their cut, Google. Instead: >If people are getting everything they need from a summary without ever clicking through, there's not much reason to watch the actual video. That means fewer views, less watch time, and less money. Do content creators get to write their own summaries or turn off Google's summary content thievery? Somehow I doubt it...
    • I know with my isp they will only support certain models. You might want to check with them,
    • Steam Summer Sale 2025 is here offering weeks of massive discounts for PC gamers by Pulasthi Ariyasinghe It is time to jump into another Steam Summer Sale. The 2025 edition of the yearly massive sale at the biggest PC gaming store on the market has just kicked off, and it is touting thousands of discounts for everything from the oldest classics to the newest releases and everything in between. The Steam servers predictably wobbled for a while at the launch of the sale, but things finally seem to be calming down enough to browse the latest sales. The front page is the place to be for anyone looking for recommendations, with it putting the spotlight on fresh games every day. However, keep in mind that the discounts themselves will not be changing and will remain static throughout the sale. Some recent blockbusters like Metaphor: ReFantazio, Monster Hunter Wilds, Sid Meier's Civilization VII, Black Myth: Wukong, Call of Duty: Black Ops 6, Clair Obscur: Expedition 33, Warhammer 40,000: Space Marine 2, Indiana Jones and the Great Circle, Blue Prince, Kingdom Come: Deliverance II, and much more are currently discounted. Valve has also brought back the special "Deep Discounts" section, letting Steam users find the most deeply discounted games quickly straight from the front page. The page has a selection of "all-time greats" with 85% to 95% cuts to their standard prices. This time, it includes titles like Black Mesa, Little Nightmares II, Kerbal Space Program, Steins Gate, Furi, Crash Bandicoot N. Sane Trilogy, Star Wars Battlefront II, Robocop Rogue City, and much more for just a few dollars each. As for the duration, the Steam Summer Sale of 2025 will be open for business until July 10, giving all of you two whole weeks to try and keep your wallets closed tight. As always, be sure to read our Weekend PC Game Deals special this coming Saturday to check out the biggest highlights from the sale. If you miss this store-wide promotion, Valve's next major sale will land this September as part of a new time slot for the Steam Autumn Sale. Head over here to see the complete 2025 sales roadmap for the platform.
    • Great way to get an entire physical model of the products (i.e. end users) and better market them...definitely not something I'd want on ANY of my personal devices, but can be useful in retail shops for sure.
  • Recent Achievements

    • First Post
      TheRingmaster earned a badge
      First Post
    • Conversation Starter
      Kavin25 earned a badge
      Conversation Starter
    • One Month Later
      Leonard grant earned a badge
      One Month Later
    • Week One Done
      pcdoctorsnet earned a badge
      Week One Done
    • Rising Star
      Phillip0web went up a rank
      Rising Star
  • Popular Contributors

    1. 1
      +primortal
      552
    2. 2
      ATLien_0
      205
    3. 3
      +FloatingFatMan
      180
    4. 4
      Michael Scrip
      147
    5. 5
      Som
      119
  • Tell a friend

    Love Neowin? Tell a friend!