Solved Removing first characters in a file name

September 16, 2011 at 07:16:58
Specs: Windows XP

I have many files with different lengths in the same folder and would like to remove the first 8 characters (from the left) from all of them.

Here are some examples of file names I would like to rename:

I'm trying using this script but it's not working... :(

echo off

REN "* " *.*"
FOR %v IN (*.*) DO REN "%v" %v

Someone there to help me? :)

See More: Removing first characters in a file name

Report •

September 16, 2011 at 09:24:00
✔ Best Answer
In your script there are commands unknown to Windos batch and your question is an issue to be posted in Programming Forum since there is no DOS in XP just NT batch. Anyway here the requested code.

@echo off & setlocal EnableDelayedExpansion
cd /D Your_Folder
for %%j in (SANTOS6_*.*) do (
  set newname=%%j
  set newname=!newname:SANTOS6_=!
  ren "%%j" "!newname!"

Report •

September 16, 2011 at 10:24:22
Thank you very much!!

And sorry for the wrong way to post it... my first time here, got a bit confused. And I'm using Linux/Unix with VMWare Player.

Report •

Related Solutions

Ask Question