Saturday, May 25, 2024
HomeWindowsWindows: Create a Share on a Remote PC from the Command Line

Windows: Create a Share on a Remote PC from the Command Line

By using the Windows Instrumentation command-line interface (WMIC), you can share an existing directory on a remote PC on your network. This can save some time when a directory needs to be shared immediately and the user does not know how to create the share. This Tech-Recipe applies to Windows XP Professional, Windows Vista, Windows Server 2003 and Windows Server 2008.

(a) You must have administrative rights on the remote PC.
(b) The directory that is to be shared must already exist on the remote PC.
(c) This will create a basic share, you cannot set the permissions from WMIC.

1. Open a command prompt.

2. Input WMIC to bring up the wmic prompt.

3. At the wmic prompt, execute the following command:
/node: /user:"\" /password: share call create "", "", "", "", "", 0

computer name is the name of the computer that is to share the directory.
domain is the domain the computer is in.
username is the username with administrative rights on the PC.
password is the password for the above username.
comments is the description of the share.
maximum number of connections is set to a desired level.
share name is what the share will be named.
path to folder is the local path of the folder you wish to share.

4. When prompted as to whether you wish to execute the command, type Y and press Return.

Upon execution, the directory will be shared on the remote computer.

Rob Rogers
Rob Rogers
Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.


Please enter your comment!
Please enter your name here

Most Popular


Recent Comments

error: Content is protected !!