I am trying to write a batch file that will set the value that a command returns to a variable.
For example
I have a command called strings which returns the first 4 letters of a string.
It is used by writing
strings left today,4
and will return toda (the first 4 letters of today)
I want to set a variable to be the value that is returned, so that I can then test it.
I have tried
%6 = (strings left today,4)
if %6 == "toda"
Another way I have tried is to output the value to a file.
strings left today,4 > output.txt
but I don't know how to read the value of output.txt into a variable.
Can someone help me do this?