set "link2='^&format=json" should set link2 as you require (you don't say...)
With an argument of hello, echoing the "chrome" line produces
"chrome.exe" "https://query.yahooapis.com/v1/public/yql?q=select * from geo.places where text='hello'&format=json"
"chrome.exe" "https://query.yahooapis.com/v1/public/yql?q=select * from geo.places where text='hello'&format=json"
for me - and produces no error report.