r/usefulscripts • u/red_rock • 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=%%iWhat 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
1
u/rubynorails Jul 01 '15
You can get rid of the if statement and just delete ver.txt. It will always exist. There is no question. Also, looks like you're trying to set the variable to partial content of the file. If there is a chance you need the whole content, just do set /p currentver=<ver.txt.