Batch process Create a full, read-only shared folder batch code _dos/bat

Source: Internet
Author: User
Copy Code code as follows:

:: Create a share:
NET share Mp3$=d:\mp3/unlimited/remark: "This is a full share"/cache:no
NET share Mp4$=d:\mp4/users:10/remark: "This is also a full share, to set the read-only, adjust the permissions yourself"/cache:no
:: Shared read-only and full-share, default is full share, I didn't find parameters to set this share permission,
:: You can set permissions manually, such as the use of batch settings, disguised with cacls settings,
@echo y|cacls d:\mp3/c/P everyone:r administrators:f system:f "Network Service": F>nul
@echo y|cacls d:\mp3\*.*/c/p everyone:r administrators:f system:f "Network Service": F>nul

:: View shares:
NET share mp3$
NET share mp4$
:: Delete net share mp3$/delete
NET share mp4$/delete

Pause


To explain one more thing,
NET share Mp3$=d:\mp3/unlimited/remark: "This is a full share"/cache:no
The meaning is to share D:\mp3, share name is mp3$,/unlimited is used in the server more, is the number that does not limit connection,
Conversely, if you want to limit the number of connections, use/users:8 means to limit the number of simultaneous connections to 8 PCs.
/remark is an explanation that/cache:no does not require an offline cache.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.