On Linux the forward slash is a path separater. On Windows the backslash is a path separator and the forward slash generally indicates an argument.

Therefore, Windows thinks you are trying to run a command called "." and parsing it the argument "/name.sh". The correct convention would be ".\name.sh". Additionally Windows will automatically search the current directory for your command so you could just type "name.sh".

The next problem you will face is that Windows does not know what a sh script is, again this is a Linux thing. You could solve this by installing Cygwin if you really want or need to run a sh script.

However, judging by one of your previous comments you could just as well rename the script to name.bat and delete the "#!/bin/sh" line. Now you have a Batch file which Windows should understand. You can read more about batch files here.

You're trying to run your car on orange juice instead of gasoline. Windows shares similar commands stored in .bat or .cmd files with Unix/Linux/zOS Unix Subsystem/*ix shell scripts as these two families of operating systems share a common ancestor the DEC PDP-x machines.

If you want instant gratification, you will need to install an environment that provides a "sh.exe" program or "csh.exe" or "bash.exe" program (tsh.exe anyone?)

Alternatively, if you know Unix script commands, very well, and you know Windows .cmd and .bat file commands, very well, you can translate the .sh file into a .bat or .cmd file. Even so, you will often encounter more Unix-styled programs that have no equivalent under Windows--grep, sed, vi, emacs, etc. Thus, the call to install CygWin (no minimalist)--just to get the shell and Unix tools. Put it on a flash-drive, for these special occasions.

It's possible that the problem is actually within the file name.sh -- you are trying to use the . command but it is attempting to run a kind of shell (e.g., csh, I think) in which that's not a valid command.

So: does name.sh start with the correct #!/bin/sh (if you are actually trying to run sh)?

ok, there's a LOT wrong with that - drop the #!/bin/sh, and change the extention to bat, and it might work with a few more fixes. Then you can just invoke it by its filename as well.

The syntax of a unix shell script, and a windows batch file arn't too similar. cygwin, or a load of messing around with unxutils might make something that would work in both, but unless you're ABSOLUTELY sure the environment is always the same, it isn't worth the headache

drop the #!/bin/sh, and change the extention to bat, and it might work with a few more fixes. What?! I suspect you never tried this... On Windows, even the simpliest bash capabilities are unsupported or require lengthy syntax.
–
Camilo MartinAug 31 '12 at 14:29

The second paragraph covers the fact that its likely to not work, without a fair amount of work.
–
Journeyman Geek♦Aug 31 '12 at 15:09