I am trying to call a function present in saur.exe using bat.
It looks something like this:
saur.exe readName
When i execute it, it returns a string “Saurabh”.
Now that I want to store “saurabh” in a variable called name.
So I am doing :
set name = saur.exe readName
echo .%name%
In this case, it doesnot execute.
It gives blank in front of echo command.
Some SET command documentation will show that you can only assign strings to environment variables (http://www.computerhope.com/sethlp.htm).
In your example above, you have actually set an environment variable called:
"name "Yet you are echoing the variable:
"name"The best solution I can find is to do something similar to
Hopefully this helps 🙂