CODE: [Copy to clipboard]@echo off setlocal enabledelayedexpansion set w=abcdefg set n=0 set str1=!w:~%n%,6! echo %str1%