mkshare

shares a directory 

Command


SYNOPSIS

mkshare [-S hostname] [-a access] [-r remark] [-p path] [-n sharename] [-u uses] [-fvP] [path [sharename [remark ...]]]


DESCRIPTION

The mkshare utility shares a directory with the rest of the network. Such a shared directory is called a share.

Normally, the directory to be shared, the name to use for the created share, and any associated comments with that share are specified with the -p, -n, and -r options. However, you can also specify them with arguments that follow the option list. The first argument following the options is treated as path and is processed as if you specified -p path. The second argument is treated as sharename and is processed as if you specified -n sharename. The remainder of the arguments are treated as remark and are processed as if you specified -r remark.

If you do not specify any arguments or options, a usage message is displayed.

Options

-a access 

sets the access level for the shared directory. This option is only relevant for shares residing on Windows 95/98/Me systems; it is ignored when dealing with shares that on 7/2008R2/8/2012/10/2016 systems.

The mkshare -a option can set the following access permissions when sharing a directory that resides on a Windows 95/98/Me system:

Read        readonly
Full        full access

Although you cannot use the mkssare utility to set access levels when sharing directories that reside on 7/2008R2/8/2012/10/2016 systems, you can use the chacl utility (if you are working on a 7/2008R2/8/2012/10/2016 system) to set and change user access permissions for the created share. Similarly, you can use the lsacl utility to list the share's permissions. With the chacl command, you can set the following user access permissions for shares that reside on 7/2008R2/8/2012/10/2016 systems:

Read        read permissions
write       write permissions
create      create new files
exec        execute programs
delete      delete file or folders
attrib      change attributes
perm        change permissions
-f 

forces mkshare to overwrite an existing share with the same name as the share to be created. That is, the existing shared is removed and the new share is created.

-n sharename 

specifies the name of the created share. If sharename is a UNC name of the form //hostname/name, the effect is the same as specifying -S hostname -n name.

If you do not specify this option or the standalone sharename argument, the base name of the directory to be shared is used as its name. The base name is the same value as returned by the command:

basename directory

If the directory to be shared is the root directory of a drive, the drive letter will be used as the sharename.

-P 

on Windows 95/98/Me systems, forces the created share to be persistent across boots. This option is ignored on 7/2008R2/8/2012/10/2016 systems, where all shares are persistent across boots.

-p path 

specifies the directory to share.

-r remark 

specifies an additional remark (or comment) to be associated with the created share. If you specify both the -r remark option and a standalone remark argument, the standalone argument is appended to the option argument to create the full remark.

-S hostname 

specifies the remote machine on which the directory to be shared resides.

Note:

When running this utility on a 7/2008R2/8/2012/10/2016 system and using the -S to specify a remote Windows 95/98/Me system, some operations may fail, due to limitations in the operating systems.

-u uses 

specifies the maximum number of concurrent uses that is to be allowed for the created share. By default, the number of concurrent uses for a share is unlimited.

-v 

verbose. When this option is specified, mkshare displays additional information about the created share.


EXAMPLES

The following commands:

mkshare c:/dir1
mkshare -p c:/dir1
mkshare -p c:/dir1 -n dir1

all share the c:/dir directory with the share name of dir1, while the commands:

mkshare c:/dir1 sharedir
mkshare -p c:/dir1 -n sharedir

both share the c:/dir directory with the share name of sharedir, and the commands:

mkshare c:/docdir //venus/docshare
mkshare -S venus -n docshare -p c:/docdir 
mkshare -n //venus/docshare -p c:/docdir 

all share the c:/docdir directory on the remote machine venus with the share name of docshare.


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

An error occurred.

2 

A usage error occurred.


PORTABILITY

Windows 7. Windows Server 2008 R2. Windows 8. Windows Server 2012. Windows 10. Windows Server 2016.


AVAILABILITY

PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
chacl, lsacl, lsshare, rmshare


PTC MKS Toolkit 10.1 patch 1 Documentation Build 2.