DEV Community

Victor James
Victor James

Posted on • Originally published at windowscmd.com on

RMTSHARE Command: Shares a Folder or a Printer

RMTSHARE

RMTSHARE

The RMTSHARE windows command-line tool is to share a folder or a printer. To know more about this windows command, read this article fully.

CMD Line

CMD Line is a ** text-based interface** that transfers the command from the user to the OS.

CLI-Command Line Interpreter

The command-line interpreter (CLI) for windows is CMD.EXE. Also, you can use PowerShell, which can automate many system administration tasks and these tasks are not approachable in command prompt. With the help of the CLI, you can communicate with your system by typing the text in commands. As a result, your system answers to the text that you have typed previously, and then the user can proceed with the following command line that shows up.

To open the Run command Window.

Run command window helps you to run programs, open the files and folders. And there are several ways to open up the run command dialog box. This run command box is helpful for you to head straight to the destined program quickly.

By using the Keyboard shortcut Key:

WINDOWS+R

The shortcut key method to the run command box is the most commonly used one. Also, this method is in all versions of Windows. It would help if you pressed the Windows+ R ** ** key concurrently to open the Run command dialog box.

Run command box
Run command box

What does the RMTSHARE command do?

The RMTSHARE command-line utility tool manages ** the files, and the printer shares or on a local or a remote server*. This command is to **create * and modify shares on the small machines.

Syntax

  • Code to display all shares

 RMTSHARE \\server

Enter fullscreen mode Exit fullscreen mode
  • To display details of a particular share

RMTSHARE \\server\sharename

Enter fullscreen mode Exit fullscreen mode
  • Code to share a folder

RMTSHARE \\server\sharename=drive:path [options]

Enter fullscreen mode Exit fullscreen mode
  • Code to delete a folder

RMTSHARE \\server\sharename /DELETE

Enter fullscreen mode Exit fullscreen mode
  • This code is to edit an existing share

  RMTSHARE \\server\sharename [options]

Enter fullscreen mode Exit fullscreen mode
  • Code for sharing a printer

RMTSHARE \\server\sharename=printername /PRINTER [options]

Enter fullscreen mode Exit fullscreen mode

Available Options


      /USERS:number
      /UNLIMITED
      /REMARK:"text"
      /GRANT user:perm
      /REMOVE user

Enter fullscreen mode Exit fullscreen mode

To restrict ** the number of connections that we can create, mention **/Users, or else mention ** /UNLIMITED*. One can also add * /GRANTS**. You can close a path with spaces like,


\\server\"long share name"="c:\long file name"

Enter fullscreen mode Exit fullscreen mode

PowerShell

On PowerShell , there is a method to list remote shares; we have given that below.


# List the file shares on the remote server: ADMINSERVER.

$shares = Get-WmiObject -class Win32_Share -computername ADMINSERVER -filter "Type=0"
$shares | foreach {
    $path=($_.path)
    $Description=($_.Description)
    $name=($_.name)
    $Caption=($_.Caption)

    "Share Name : $name
     Source Folder: $path 
     Description : $Description
     Caption : $Caption"
    }

Enter fullscreen mode Exit fullscreen mode

Verdict

This article will help you to know about the *RMTSHARE * command. If you want to learn more about the windows command, visit our webpage. Leave your valuable comments in the comment section.

Related Articles

The post RMTSHARE Command: Shares a Folder or a Printer appeared first on Windows Commands- SS64 Commands.

Discussion (0)