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.


Limitations:
(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

Where:
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.
RELATED ARTICLES

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments

Cleveland Furia on How to Clear Google Activity
Sid Wohlfarth on How to Clear Google Activity
Riley Magsayo on How to Clear Google Activity
สมัครรับเครดิตฟรี ทันที on How to improve Remote Desktop Protocol Performance
Neal Wangstad on How to Clear Google Activity
Slavcho Andov on How to install Ubuntu
Slavcho Andov on How to fix bad sectors
Sheraz Ali on How to Backup Android