Sharing a folder and setting permissions in PowerShell

前端 未结 4 1923
刺人心
刺人心 2021-02-12 22:31

I need a script to run on Vista Ultimate to share an external drive and assign full control to Everyone. I\'ve got a batch file to create the share using net share,

4条回答
  •  太阳男子
    2021-02-12 23:04

    In case you're searching for an answer to this question, but you're running Windows 7 (instead of Vista), as I was, you might be interested to know that permissions can be set in the NET SHARE command, now, directly.

    For instance,

    NET SHARE Movies=M:\Movies /GRANT:Everyone`,READ

    will create a share and give Everyone read-only permissions to it.

    Instead of READ, you can use CHANGE or FULL as well.

提交回复
热议问题