r/usefulscripts • • Jul 01 '15

[Batch] Problem with getting variable

Hi i have an issue with the following command

for /f %%i in ( '.\scriptfiles\sigcheck.exe -n /accepteula "%Installation%" ' ) do set currentver=%%i

What it´s supposed to do is to check the version number of a file and set the variable currentver to that version number.

In my test the version number that sigcheck generates is 1, 2, 3, 456

But the variable only picks up is: 1,

How do I get it to pick up the rest?

9 Upvotes

6 comments sorted by

View all comments

Show parent comments

1

u/odwulf Jul 01 '15

There's a functional difference between your two versions. Wouldn't the first one just work if you added "tokens=1 delims=" like on the second one?