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 ...
-
4th August 2010, 12:49 PM #1
- Rep Power
- 0
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:
034001,C:\Users\034001
034002,C:\Users\034002
034003,C:\Users\034003
034004,C:\Users\034004
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.
-
-
IDG Tech News
-
4th August 2010, 03:08 PM #2
-
SHARE: 
Similar Threads
-
By darrenstraight in forum Windows 7
Replies: 12
Last Post: 22nd December 2011, 04:39 AM
-
By Athlona in forum Windows Server 2000/2003
Replies: 4
Last Post: 24th April 2010, 05:38 AM
-
By Chuckster in forum Coding
Replies: 1
Last Post: 8th October 2009, 02:29 PM
-
By mitchell1981 in forum Windows
Replies: 4
Last Post: 11th July 2007, 12:33 PM
-
Replies: 15
Last Post: 12th October 2006, 09: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
-
Forum Rules