# maybe this is stupid but from os import listdir def get_chrome_ver(mypath): return(listdir(mypath)[0]) print(get_chrome_ver('C:Program Files (x86)GoogleChromeApplication'))