0

Ok, I been struggling with this for days now. I have a little complex script but at the end I just need to set a variable from a Token 4 to the end of the line. Basically I run a command and the output has some words in the beginning that I don't need on my variable. But for resume this is what I want:

set _EVer=Garbage Garbage Garbage This is an example for /F "tokens=4*" %%G in ('echo "%_EVer%"') do set "_EVerC=%%G 

I need that the output that I got "Garbage Garbage This is an example" set a variable "This is an example"

I tried tokens=4* but just sets the first word and nothing else.

Any comments will be welcome :) THANKS

1

1 Answer 1

0

as JosefZ comment the solution was:

set _EVer=Garbage Garbage Garbage This is an example for /F "tokens=3*" %%G in ("%_EVer%") do set "_EVerC=%%H" 

The set %%H was the fix. More information https://ss64.com/nt/for.html

"If the clause results in a multiple values then extra parameters are implicitly defined to hold each. These are automatically assigned in alphabetical order %%H %%I %%J ...(implicit parameter definition)"

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.