The syntax of this command is:
NET SHARE sharename
sharename=devicename[,...] [/PRINT] [/USERS:# | /UNLIMITED]
[/REMARK:"text"] [/YES]
sharename [/PRINT [/YES]]
sharename=drive:path [/USERS:# | /UNLIMITED] [/REMARK:"text"] [/YES]
sharename [/USERS:# | /UNLIMITED] [/REMARK:"text"]
{sharename | devicename | drive:path} /DELETE [/YES]
This command creates, deletes, modifies, or displays shared
resources. Use this command to make a resource available to
clients.
Before you can share a printer queue, you must configure
your printer(s) through the UNIX System Administrative
Interface, or Clipcache for client printers, or the network
printer utilities for network printers. Similarly, before you
can share a directory, you must create it.
OPTIONS
sharename - is the network name for a shared resource.
Use the "net share" command with a sharename to
display information about a resource. A share name
can be up to 12 characters in length. Do not use
any of the following as a sharename:
COMM PRINT
DEV QUEUES
MAILSLOT SEM
1PIPE SHAREMEM
devicename - specifies one or more printers shared by
sharename. Separate multiple devicename entries with a
comma.
pathname - specifies the absolute path of a directory to be
shared (including the drive id). A directory must
exist before you can share it.
The pathname must be the complete path to the
directory, beginning with the root directory. For
example, to specify the directory kate, which is a
subdirectory within market, you would type the
following:
net share research=c:/market/kate
/PRINT - identifies the resource as a printer queue.
/USERS:# - sets the maximum number of users who can
simultaneously access a shared resource.
/UNLIMITED - sets the maximum number of users who can
simultaneously access a shared resource to the number
maximum number allowed by the license of the server.
/REMARK:"text" - adds a descriptive comment about the
resource. Enclose the text in quotation marks.
/DELETE - stops sharing the resource.
/YES - Executes command without asking for confirmation.
COMMENTS
To display information about all resources being shared on the
server, type "net share". When you display all the shared
resources at a server, it reports the sharename, the devicename(s)
or pathname associated with it, and a descriptive comment.
The display is similar to the following:
Sharename Resource Remark
-----------------------------------------------------------------------
ADMIN$ C:\VAR\OPT\LANMAN Admin Share
IPC$ IPC Share
C$ C:\ Root Share
D$ C:\VAR\OPT\LANMAN\SHARES SystemRoot Share
REPL$ C:\VAR\OPT\LANMAN\SHARES\WIN... REPL MASTER
TOOLS C:\VAR\OPT\LANMAN\SHARES\AST... Solaris (TM) PC NetLink Tools
DOSUTIL C:\VAR\OPT\LANMAN\SHARES\DOS DOS Utilities
LIB C:\VAR\OPT\LANMAN\SHARES\LIB Programming Aids
NETLOGON C:\VAR\OPT\LANMAN\SHARES\WIN... Logon Script Directory
PRINTLOG C:\VAR\OPT\LANMAN\SHARES\PRI... LP printer messages
USERS C:\HOME2\LANMAN Users Directory
The command completed successfully.
Most users have home directories on the server, a directory in
which they can store files and from which they can share files.
There are two ways to create new home directories:
- To create a new directory from a client, complete
the following steps:
1. Log on as a user with administrative
privileges.
2. Link to the UNIX system server's C$ resource
by typing "net use x: \\server_asu\c$"
3. Change directories to the path specified in
the \SYSTEM\CurrentControlSet\Services\
LanmanServer\Parameters\UserPath value in
the Registry. For example, UserPath could
have the value c:\home\lanman.
4. Type mkdir directoryname and press "return".
- To create a new directory on the UNIX operating
system, complete the following steps:
1. Log on to the server console as root.
2. Change from the current directory, if you do
not want the new directory to be in root's
home directory.
3. At the system prompt, type mkdir
directoryname and press "return".
4. Change the permissions, ownership, and group
for this directory to agree with the
server's permissions, ownership, and group.
- To change the permissions, type the following:
chmod 775 directoryname
- To change the owner, type the following:
chown lmxadmin directoryname
- To change the group, type the following:
chgrp DOS---- directoryname
Use the following forms of the "net share" command to share resources:
- To share an existing directory, type the
following:
net share sharename=pathname
- To create and share a printer queue, type the
following:
net share sharename=devicename /print
- To share a printer queue without assigning a
devicename, or to share an existing printer queue,
type the following:
net share sharename /print
To establish security restrictions for a resource use the
"net perms" command (for permissions) and the "net user"
command (for users' passwords).
EXAMPLES
After you have configured your printer(s) on the UNIX
system, you can share a printer queue. In this example,
acct_asu is the name of the server; laserprt is the name
of the shared printer queue; and hplaser is the name of the
printer. From a UNIX system console, type the following:
net share laserprt=hplaser /print
To share the two printers with the UNIX system LP subsystem
printernames hplaser and att495 as a printer pool served by
a single printer queue, type the following:
net share pool1=hplaser,att495 /print
To stop sharing a resource, type the following:
net share sharedir /delete
where sharedir is the name of shared resource to be
disconnected.
To run the same command remotely (on server "market_asu"), type
the following (replacing "password" with the password for
"administrator":
net admin \\market_asu password /command net share
sharedir /delete
SEE ALSO
For information about See
_____________________ _________
Getting help with network commands net help
Assigning permissions to resources net perms
Defining, controlling, and deleting net print
printer queues
To get Help on command options, type "net help {command} /options | more".
To get Help one screen at a time, type "net help {command} | more".