When you select Network in the left pane of
any Windows Explorer view, the top of the window lists some tasks that
can help you manage your network:
Network and Sharing Center—
Opens the Network and Sharing Center window, which you can use to make
new network connections, and also change the Home, Work, or Public
label for your current network.
Add a Printer— Opens a wizard to connect to a printer, either a locally attached or a networked printer.
Add a Wireless Device— Opens a wizard to assist in adding a wireless device such as a wireless printer or network card.
Additional tasks related to using a network can be performed from within the Network and Sharing Center:
Set Up a New Connection or Network—
Starts a wizard to connect to other types of networks, for example, to
define a connection to a corporate network via modem or over the
Internet.
Connect to a Network—
Displays a list of active and defined network connections. This can be
used, for example, to actually connect to another network via dial-up
or VPN networking.
Choose Homegroup and Sharing Options— Lets
you join or leave a homegroup, and control what libraries are shared
with the group. The tasks you can perform from here are described
shortly.
Change Advanced Sharing Settings— Lets you control networking services and select whether or not passwords are required on your network.
Troubleshoot Problems— Lets you start troubleshooters to investigate and repair common network problems.
If
you select Choose Homegroup and Sharing Options, you can perform
several tasks to work with your homegroup. If you aren’t currently a
member of a homegroup, you’ll be able to create one, provided that your
network location is set to Home Network. If you are member of a
homegroup already, there are several actions you can select:
View or Print the Homegroup Password— Click this to redisplay the password that other computers need to join your homegroup.
Change the Password—
Click to select your own password for your homegroup. We suggest that
you keep the random one that Windows generates for you, but you can
change it if you like. If you do want to change it, it’s best to do so
before you join other computers to the group. And don’t
change it to your own user account password or one you use for, say,
your online banking, since anyone who uses a member computer can view
this password.
Leave the Homegroup— Click to remove your computer from the group.
Change Advanced Sharing Settings— Click to change networking features such as Password Protected Sharing.
Start the HomeGroup Troubleshooter— Click if you encounter problems connecting to other homegroup users or computers.
In
addition, Windows provides tools that you can use to monitor the use of
the files you’re sharing, and command-line tools that you can use to
manage network resources that you use and share.
Monitoring Use of Your Shared Folders
If
you’ve shared folders on your LAN, you might want to know who’s using
them. For example, you might need to know this information if someone
were editing a file in your shared folder. If you tried to edit the
same file, you’d be told by your word processor that the file was “in
use by another.” But by whom?
The Computer
Management tool can help you. Open the Start menu, right-click
Computer, select Manage, and open the Shared Folders item in the left
pane. The Sessions and Open Files sections can show you who is using
your shared folders, and which files they currently have open. In an
emergency, you can right-click and disconnect a user or close an open
file with the Delete key. (This is a drastic measure and is sure to
mess up the remote user, so use it only when absolutely necessary.)
Managing Network Resources Using the Command Line
If
you find yourself repeating certain network and file operations day
after day, it makes sense to try to automate the processes. You might
get so used to the graphical interface that you forget the command
line, but it’s still there, and you can perform drive mappings and
printer selections with the command line almost as easily as from the
GUI.
The net command comes to us
virtually unchanged since the original PC network software developed by
Microsoft and IBM debuted in 1984. There are so many variations of the net command that I think of them as separate commands: net view, net use, net
whatever. Each net command contains a word that selects a subcommand or operation type.
Interestingly, the net
command not only can manage and explore your network, it also can start
and stop Windows services and create user accounts and groups. You can
get online help listing all the net subcommands by typing net /?, and get detailed help by typing net
command
/?, where command is any one of the net subcommands.
The most common use of the net command is to map network folders to drive letters, and network printers to LPT ports for use by MS-DOS programs, using the net use format. Net use
makes and disconnects drive mappings, and establishes printer
redirection for command-line programs. The basic command is as follows:
Tip
If the drive mapping didn’t exist beforehand, the /delete
command will print an error message. That’s fine if you’re typing
commands directly in the Command Prompt window. If you perform drive
mapping in a batch file, the error message would be disconcerting. You
can prevent it from appearing by issuing the command this way: net use q: /delete >nul 2>nul
NUL is a special filename to Windows; it’s basically a black hole for data. |
The following example maps drive letter Q to the shared folder \\abalone\book:
net use q: \\abalone\book
You
can’t replace the shared folder attached to an already mapped drive, so
you should try to delete a previous mapping before trying to make a new
one:
net use q: /delete
net use q: \\abalone\book
Here
is an example of a batch file that performs a simple
computer-to-computer backup of some important files. Let’s say I want
to back up the folder C:\book, and all of its subfolders, from my computer to a shared folder on another computer named abalone. I could put the following commands into a file named backup_book.bat:
@echo off
net use q: /delete 1>nul 2>nul
net use q: \\abalone\book
xcopy c:\book q: /e /r /c /y
net use q: /delete
net use
also maps network printers to the legacy DOS printer devices LPT1,
LPT2, and LPT3. The only way to redirect DOS program output to a
network printer is through net use.
The following command directs DOS application LPT1 printer output to the network printer:
net use lpt1: \\server\printername
The following command cancels it: