You do not need a ".", But otherwise it will work.
console.log(s.replace(/\\\\/g, '\\'));
If this does something wrong, I suggest that your testing method might have a problem with it.
edit - Note that to verify this with the suggested source string, you must double the backslash:
var s = "\\\\cpmp1\\D$\\\\ABC\\\\XYZ";
source share