1

I'm wondering if it's possible to add a Network Location via the command prompt? This is not a drive letter mapping mind which can be achieved using the net use command.

jscott
  • 24,484
  • 8
  • 79
  • 100
noonand
  • 287
  • 1
  • 7
  • 25
  • do you mean a connection to a unc path? you could use pushd if you don't want to use net use. pushd \\server\share or if you need to authenticate against the share and don't want to use a drive letter: net use \\server\share /user: && pushd \\server\share – grub Oct 02 '10 at 14:07
  • No dice - this is the network locations available from Vista onwards... – noonand Nov 07 '10 at 19:16

2 Answers2

0

Here is a script how to achieve this:How Can I Create a Shortcut in My Network Places?

To use them:

  • Copy the code into a Notepad file
  • Click File menu & choose SaveAs
  • Surround the file name in double quotes including the extension (") Example "Network Place Scrript.vbs"
  • In the File Types choose All Files
  • Click the Save button
Guido van Brakel
  • 942
  • 5
  • 10
  • Superb, thanks for that! I had actually come across that article but neglected to circle back to this question. Fair dues to you for doing so. – noonand Mar 08 '11 at 09:19
  • People going to that article should read the very informative comment made by JRV in the comments section. – noonand Jan 08 '13 at 15:06
0

you can use PUSHD and POPDcommands

    C:\>PUSHD /?
Stores the current directory for use by the POPD command, then
changes to the specified directory.

PUSHD [path | ..]

  path        Specifies the directory to make the current directory.

If Command Extensions are enabled the PUSHD command accepts
network paths in addition to the normal drive letter and path.
If a network path is specified, PUSHD will create a temporary
drive letter that points to that specified network resource and
then change the current drive and directory, using the newly
defined drive letter.  Temporary drive letters are allocated from
Z: on down, using the first unused drive letter found.

C:\>
C:\>
C:\>POPD /?
Changes to the directory stored by the PUSHD command.

POPD


If Command Extensions are enabled the POPD command will delete
any temporary drive letter created by PUSHD when you POPD that
drive off the pushed directory stack.

C:\>
Haim Cohen
  • 111
  • 2