B00TI8DTJY.PT01.jpg "I know how to remove a certain amount of characters or add something to the file name but can't figur" name="description" /> B00TI8DTJY.PT01.jpg "I know how to remove a certain amount of characters or add something to the file name but can't figur" />
44506

I'm trying to remove “ .RETCH ” from my file names with my batch script

Question:

I'm simply trying to have my existing script remove " .RETCH " from the file name.

ex. " B00TI8DTJY.RETCH.PT01.jpg --> B00TI8DTJY.PT01.jpg "

I know how to remove a certain amount of characters or add something to the file name but can't figure out how to Only remove the .RETCH part.

Thanks.

Answer1:

setlocal enabledelayedexpansion for /f %%a in ('dir *RETCH* /b') do ( set "name=%%a"&set "name=!name:.RETCH=!" ren "%%a" "!name!" )

Just run this on the same directory as your files. If it's needed to go on subdirectories then add /s flag to dir command.

Recommend

  • PHP file_exists() anomaly
  • custom string delimiters stringtemplate-4
  • MVVM: Image Bind Source from FileOpenPicker
  • Insertion large number of Entities into SQL Server 2012 [duplicate]
  • Ruby 1.8.6 Array#uniq not removing duplicate hashes
  • Accessing Rows In A LINQ Result Without A Foreach Loop?
  • cell spacing in div table
  • apply a javascript function to draggable copy
  • Time out Error in send mail
  • What is the correct way to synchronize a shared, static object in Java?
  • ApplePay PKPaymentAuthorizationViewController always shows processing
  • XSLT foreach repeating nodes to flat
  • How to create a 2D image by rotating 1D vector of numbers around its center element?
  • Validate jQuery plugin, field not required
  • Yii2: Finding file and getting path in a directory tree
  • Thread 1: EXC_BAD_ACCESS (code =1 address = 0x0)
  • Android changing fragment order inside FragmentPagerAdapter
  • How to make JSON.NET deserialize to Microsoft Date Time?
  • WPF ICommand CanExecute(): RaiseCanExecuteChanged() or automatic handling via DispatchTimer?
  • How solve “Qt: Untested Windows version 10.0 detected!”
  • Create DicomImage from scratch using Dcmtk
  • Groovy: Unexpected token “:”
  • Syntax for setting draggablecursor property in google maps api
  • DomPDF {PAGE_NUM} not on first page
  • Javascript simulate pressing enter in input box
  • Resize panoramic image to fixed size
  • angularjs unit test when to use $rootScope.$new()
  • Javascript Callbacks with Object constructor
  • How can I use Kendo UI with Razor?
  • When should I choose bucket sort over other sorting algorithms?
  • Importing jscolor library in angular 2
  • A cron job substitute?
  • JTable with a ScrollPane misbehaving
  • Angular 2 constructor injection vs direct access
  • Java static initializers and reflection
  • Android Google Maps API OnLocationChanged only called once
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?