如何在 Server 2008 中共享文件夹和内部文件夹并授予完全访问权限
我有 Windows Server 2008。我想创建一个文件夹并在网络中共享它,对所有从任何操作系统 PC(Win 7 和 Win XP)通过网络访问此文件夹和内部文件夹的人都具有完全访问权限(读取和写入) 。
我想建立一个可以在 Win XP、Vista、Win 7(32 和 64)、Server 2003 和 Server 2008 上运行的单一设置。
已经下载了 subinacl
并运行以下批处理文件
net share %1=%2 /UNLIMITED
subinacl /share %1 /grant="S-1-1-0"=F
subinacl /file %2 /grant="S-1-1-0"=F
我 %1
和 %2
分别是共享名称和文件夹路径。
我认为这个命令并没有赋予每个人访问内部文件夹的权利。我想为每个人提供对 %2
文件夹内所有文件夹和文件的完全共享和完全访问权限。
I have Windows Server 2008. I want to create a folder and share it in network with full access (read and write) to all, whoever access this folder and inner folders too via network from any operating system PC (Win 7 and Win XP).
I want to build up a single setup that can work on Win XP, Vista, Win 7(32 & 64), Server 2003 and Server 2008.
I have downloaded subinacl
and run the following batch file
net share %1=%2 /UNLIMITED
subinacl /share %1 /grant="S-1-1-0"=F
subinacl /file %2 /grant="S-1-1-0"=F
Where %1
and %2
are the share name and the path of the folder respectively.
I think this command does not give everyone right to the inner folder. I want to give full share and full access to everyone for all folder and files inside the %2
folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我有用:
启用访客帐户:
net user guest /active:yes
共享文件夹:
net share cshare=c:\shared /GRANT:Everyone,FULL
有时共享文件夹不会授予每个人完全权限,因此还要运行 Icacls 命令:
Icacls C:\shared /grantEveryone:F /inheritance:e /T
This worked for me:
Enable guest account:
net user guest /active:yes
Share the folder:
net share cshare=c:\shared /GRANT:Everyone,FULL
Sometimes sharing the folder doesn't give the Everyone FULL permissions, so run the Icacls command as well:
Icacls C:\shared /grant Everyone:F /inheritance:e /T
xcacls.vbs 脚本可以处理 NTFS 权限,您可以在此处下载 http://support.microsoft.com /kb/825751 - 您需要稍微修改它才能使其在 Windows 7 \ Server 2008 上工作,但是如果您运行 cscript.exe xcacls.vbs /?在 Windows 7 或 Server 2008 计算机上,它会告诉您如何修改它。
示例:
授予每个人对 C:\shared 和所有子文件夹的完全控制权:
cscript.exe xcacls.vbs c:\shared /G:Everyone:F /SPEC B
您也应该能够使用 NET SHARE 创建共享,但是听起来您已经涵盖了:
net share cshare=c:\shared /GRANT:Everyone,FULL
The xcacls.vbs script can handle the NTFS permissions, you can download it here http://support.microsoft.com/kb/825751 - you'll need to modify it slightly to get it to work on Windows 7 \ Server 2008, but if you run cscript.exe xcacls.vbs /? on a Windows 7 or Server 2008 machine it will tell you how to modify it.
Example:
grant everyone full control to C:\shared and all subfolders:
cscript.exe xcacls.vbs c:\shared /G:Everyone:F /SPEC B
You should be able to use NET SHARE to create the share as well, but it sounds like you've already got that covered:
net share cshare=c:\shared /GRANT:Everyone,FULL