If you want to run the command ./foo with the argument \\my\share\is\here in a shell script, then you need to use some form of quoting, because the backslash character has a special meaning of the shell. The simplest form of quoting is to put single quotes around the argument: everything between a pair of single quotes is treated literally, the only character you can't include this way is the single quote character itself.
./foo '\\my\share\is\here'
If your script is foo and you want to run it with the argument \\my\share\is\here on the command line, then there too you need to use quoting (the command line is a shell).
If you type ./foo \\my\share\is\here, then foo has no way to know what you typed. It's the shell that runs foo that parses the command line, and decides that the space after ./foo is a word separator, and that the first word is a command name to execute and the second word is an argument, and that character sequences of the form backslash+something stand for the character something. It's just the same phenomenon as if you write foo ; bar: this is a shell command to run foo, then bar; it doesn't pass the string ; bar to foo. Similarly, ./foo \\my\share\is\here runs ./foo with the argument \myshareishere. If you want to run ./foo with the argument \\my\share\is\here, you need to write what you mean, for example ./foo '\\my\share\is\here' (or ./foo \\\\my\\share\\is\\here or ./foo '\'"\\m"y\\share'\is\'"here""" or any other variation).
//my/share/is/herestyle UNC paths. You can evencdthere (something a DOS prompt wouldn't let you). Might work with Cygwin too, but I haven't tried.