Search code examples
variablesbatch-filecpu-wordwords

How to set a variable the same as another without first word?


I need to pull all words from a variable in my batch script without the first word to another variable.

ex

if %hello% had "apples are awesome" (without quotes) in it and was pulled and put into %hi%

%hi% would say "are awesome" (without quotes)

thanks in Advance


Solution

  • for /f "tokens=1*" %%a in ("%hello%") do set "hi=%%b"
    echo %hi%
    

    should work for you.