MAP DRIVES USING THE NET.EXE COMMAND

Perhaps the most common way to map a drive letter to a network drive is to use Explorer. It's possible, however, to connect these mapped drives from the Windows 98 MS-DOS prompt using the Net.exe command. You use this
method for Windows NT logon scripts, but it's also useful if you need to complete a specific task during the day (or night) that requires a remote file share.

For instance, if you need to map a drive (G) to the \\server1\work share, you could use the following command:

Net use g: \\server1\work

However, if there is already a drive G mapped on the PC, this will only return an error. To work around this, it's common practice to run the following command before the command that maps the drive:

Net use g: /delete

This deletes the current mapping of G, allowing the new mapping to complete successfully.

If you don't necessarily need to specify the letter used in the drive mapping, you can instead use the wildcard symbol [*]. For example, the following will map the first available drive letter (after the letters assigned to fixed disks and removable media) to the network share:

Net use *: \\server1\work