Search code examples
windowsbatch-filecmdnet-usepushd

How is Net Use different from PUSHD and the Windows Explorer?


Intermittently I'm finding that net use doesn't feel like seeing the server in front of it.

The following commmand works:

pushd \\place\otherplace\1.2.0\

Windows explorer also consistently brings me where I want to go.

For some reason, though, the following sometimes returns that the path doesn't exist.

net use R: \\place\otherplace\1.2.0\

What's the difference in implementation for net use?


Solution

  • The practical difference, for anybody writing a script that may come across this, is that pushd and windows explorer both accept \\path\to\directory\

    net use fails with a trailing slash, and requires \\path\to\directory