+ Post New Thread
Results 1 to 2 of 2
Windows Thread, Modify Share Folder Permission in Technical; I would like to ask, how to write a batch script(.bat) to read a text file, then the program will ...
  1. #1

    Join Date
    Aug 2010
    Thank Post
    Thanked 0 Times in 0 Posts
    Rep Power

    Modify Share Folder Permission

    I would like to ask,
    how to write a batch script(.bat) to read a text file,
    then the program will set the specific person to share with specific folder.

    For example, the text file "user.txt" contains the following data:

    The first column is user name, and the second column is the share folder path.
    User name and share folder path are delimited by a comma.

    Then I have coded part of the script.
    for /f %%a in ('C:\user.txt') do (
    net share %%a=%cd%\%%a /grant:everyone,full

    I don't know how to set a user, says 034001, to share with C:\Users\034001.

    It is because in the script above, the setting is to grant Everyone to have
    full permission.

    However, I only want 034001 to have full permission with C:\Users\034001
    instead of everyone.

    So, how to modify the script or does anyone have a batch file that would
    enable me to modify the permission for all folders in one hit? Really I don't
    want to do it manually!

    Thank you for your kindly help in advance.

  2. #2

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Thank Post
    Thanked 470 Times in 307 Posts
    Blog Entries
    Rep Power

+ Post New Thread

Similar Threads

  1. Replies: 12
    Last Post: 22nd December 2011, 05:39 AM
  2. Profile & Share Permission Problems:(
    By Athlona in forum Windows Server 2000/2003
    Replies: 4
    Last Post: 24th April 2010, 06:38 AM
  3. Permission on a folder
    By Chuckster in forum Coding
    Replies: 1
    Last Post: 8th October 2009, 03:29 PM
  4. Bulk Modify Share Permissions
    By mitchell1981 in forum Windows
    Replies: 4
    Last Post: 11th July 2007, 01:33 PM
  5. Replies: 15
    Last Post: 12th October 2006, 10:37 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts