A Quick Tip To Create Shared Folders Remotely

You can use Resource Kit tool called; rmtshare.exe to create shared folders remotely. You need to use three commands as mentioned below:

  • MD command to create a directory on the remote computer
  • Rmtshare.exe command to share the directory
  • Xcacls.vbs to assign permissions on the shared folder.

This is how you do it. You need to create a folder called; Incoming on C:\ drive on all the client computers. This folder is used by the Antivirus Server to store the updates and client version of Antivirus, running on client computers, pulls the updates from Incoming directory. You have found that the Incoming folder is no longer shared. You can create a small script to share this folder on all the computers in your environment:


  • Create a text file: CompList.TXT
  • Put all the client computer names in this file
  • Next, put the following commands in a file and save it as Share.CMD
  • ***START HERE*** 
  • @ Echo Off
  • setlocal enabledelayedexpansion
  • FOR /F "Tokens=*" %%L IN (CompList.TXT) DO (
  •    SET CompName=
  •    SET CompName=%%L
  •    MD \\!CompName!\C$\Incoming
  •    Rmtshare.exe \\!CompName!\Incoming$ = C:\Incoming
  •    Xcacls.VBS \\!CompName!\Incoming$ "DomainName.Com/Domain Admins":F
  • )
  • ***END HERE***

Now, run the Share.CMD from a computer which has access to all the computers mentioned in the CompList.TXT. The script runs against each computers mentioned in the CompList.TXT and execute the commands to create, share and assign the Full Control permissions to Domain Admins Security Group to share Incoming$ on all the computers.


About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top