I am trying to remove the first word from a string in batch.
Example: "this kid loves batch" to "kid loves batch"
I have tried:
@echo off
set /p text=text:
for /f "tokens=1,*" %%a in ("%text%") do set updated=%%a
echo %updated%
pause
It just outputs the first word, and does not delete the first word.
How can I make it delete the first word, and keep the rest of the string?
%%binstead of%%a.set updated=%%bFORcommand. Specifically the section about theTOKENSoption: If the last character in the tokens= string is an asterisk, then an additional variable is allocated and receives the remaining text on the line after the last token parsed. The additional variable is the next letter in the alphabet to put it in simple terms. In reality it is the next ascii character but explaining that is for another question.