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.