Search code examples
windowsbashnetwork-programmingcygwin

Cygwin's bash can't run 'net use /user' command?


I run 'net use /user:"Someone" \somewhere', and it works well with cmd.exe.

With the same cmd.exe, run 'bash --login -i' to use the cygwin/bash, and run the same command but I get the error message as follows.

System error 67 has occurred.

The network name cannot be found.

Why can't I run 'net use /user' command with cygwin/bash?


Solution

  • In cygwin's bash, you need to escape any of those forwardback slashes, as those are interpreted as escape characters.

    try this

    net use /user:"Someone" \\\\server\\share

    or use single quotes, which will pass the argument unchanged

    net use /user:"Someone" '\\server\share'