Is it possible to check in a cfg file if d: / MS_connect exists and if not check if c: / MS-connect exists and put the following variable MS_DATA_HOORN to that path?

Is it possible to check in a cfg file if d: / MS_connect exists and if not check if c: / MS-connect exists and put the following variable MS_DATA_HOORN to that path?