I am using this in my program
for %%I in (*.txt) do (
The filename is in %%I.
Now i want to separate the first 2 chracters, next 3 characters, separately.
Is this possible in DOS or Cmd.exe?
I am using this in my program
for %%I in (*.txt) do (
The filename is in %%I.
Now i want to separate the first 2 chracters, next 3 characters, separately.
Is this possible in DOS or Cmd.exe?
http://www.dostips.com/DtTipsStringManipulation.php
set first2=%%I:~0,2% && set next3=%%I:~3,3%
I think.. geez, its been a while!
@echo off
setlocal enabledelayedexpansion
for %%a in (*.mp3) do (
set oldName=%%a
Set newName=!oldName:~3!
Ren "!oldName!" "!newName!" )
exit
_Strip 3.cmd is a good name to save this to. Works for me. I have it (.mp3) to only work with mp3 files ... you can change it to (.*)
Change the ~3! to another number if you want to...... ~4! will truncate the first 4 characters of the file name.