Map Network Drive

Has anyone figured out a way to auto-complete the Map Network drive dialog?

It would be nice to have a button that would map a nework drive without having to go through the dialog, especially having to enter the folder path.

I can use a GO command with an UNC to directly connect to a network drive/share but you lose the ability to navigate the folder tree, right?

Set up a button to call the 'net use' command in a dos batch script.

Command line would be like this:

NET USE z: \\computer\share password /USER:username where you should change the parts in lower-case appropriately.

If you run "net help" you'll see a list of things that the net command can do and "net help use" will give you detailed help on the "use" command:

[devicename | *] [\computername\sharename[\volume] [password | *]]
[/USER:[dotted domain name]username]
[/USER:[username@dotted domain name]

NET USE {devicename | *} [password | *] /HOME


NET USE connects a computer to a shared resource or disconnects a
computer from a shared resource. When used without options, it lists
the computer's connections.

devicename Assigns a name to connect to the resource or specifies
the device to be disconnected. There are two kinds of
devicenames: disk drives (D: through Z:) and printers
(LPT1: through LPT3:). Type an asterisk instead of a
specific devicename to assign the next available
\computername Is the name of the computer controlling the shared
resource. If the computername contains blank characters,
enclose the double backslash (\) and the computername
in quotation marks (" "). The computername may be from
1 to 15 characters long.
\sharename Is the network name of the shared resource.
\volume Specifies a NetWare volume on the server. You must have
Client Services for Netware (Windows Workstations)
or Gateway Service for Netware (Windows Server)
installed and running to connect to NetWare servers.
password Is the password needed to access the shared resource.

  •            Produces a prompt for the password. The password is
               not displayed when you type it at the password prompt.

/USER Specifies a different username with which the connection
is made.
domainname Specifies another domain. If domain is omitted,
the current logged on domain is used.
username Specifies the username with which to logon.
/SMARTCARD Specifies that the connection is to use credentials on
a smart card.
/SAVECRED Specifies that the username and password are to be saved.
This switch is ignored unless the command prompts for username
and password. This option is not available on Windows XP
Home Edition and will be ignored.
/HOME Connects a user to their home directory.
/DELETE Cancels a network connection and removes the connection
from the list of persistent connections.
/PERSISTENT Controls the use of persistent network connections.
The default is the setting used last.
YES Saves connections as they are made, and restores
them at next logon.
NO Does not save the connection being made or subsequent
connections; existing connections will be restored at
next logon. Use the /DELETE switch to remove
persistent connections.
NET HELP command | MORE displays Help one screen at a time.
[/code]Also, Windows tends to connect automatically to shares if the username and password are the same as those used locally. (This works even if the accounts are not actually the same, e.g. they're in different domains or local accounts on different machines.) I'm not sure whether this works outside of a domain enviroment but it definitely works within one.

Using that feature is usually better since you don't have to leave your password sitting around in a batch file or button.

If you want to be able to map arbitary network paths, you could also do something like this:

net use {Rs|Enter drive letter}: {f}

Then just select the folder on the network drive in question, click your button and enter the drive letter desired.

Thanks guys, this is just what I'm looking for.

I haven't had much use for batch files in quite a while, so it didn't occur to me to NET USE.

It works great!