Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a variable length string starting with START and ending with END as delimiters.

I want to extract the string between START and END. I tried doing

SET _result=%String:~6,-4% ECHO %_result%

Its removing the first 5 characters but not the last 3 characters as I want.

Suppose, _result=STARTblahblahblahEND I am getting the output as blahblahblahEND

What I want is:- blahblahblah

share|improve this question

You could use the substring options. Would something like the below work?

share|improve this answer
Or switch to PowerShell ;) – Julian Knight Jan 17 '14 at 17:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.