by Luis de Vasconcelos.
Try "escaping" the slashes:
\\\\server1\\g$\\Data\\Moodledata
Alternatively, map the \\server1\g$\Data\Moodledata folder to a drive on your Moodle server, then use that drive in the config.php file, example:
Map \\server1\g$\Data\Moodledata to drive E:\ then configure Moodle to use it this way:
$CFG->dataroot = 'E:\'