How to share WinXP folder via command prompt?
Hi everyone, I have an assignment that requires to package ClearCase Client 2003. One of the requirements of this job is creating a Shared Folder D:\Reports with Full Local Admin Access. I am using setacl.exe v2.x. and v0X Old. I need to create a batch file that adds share, sets new user group (For Shared Folder) and reconfigures permissions. By Windows default Shared Folder Permissions set to Everyone but folder it’s self set with Local Admins, Power Users, Local Users. I have managed to change permissions on the folder, but to add share with the right settings is a challenge. If anyone knows how to do this please reply. I would appreciate it. Thanks an advance guys.
Here is what is going on:
@echo off
setacl -on "D:\test" -ot file -actn ace -ace "%computername%\administrators;p:full" /silent
setacl "D:\test" /dir /grant %computername%\Administrators /full /silent
setacl "D:\test" /dir /grant %computername%\users /write /Change /silent
setacl "D:\test" /dir /grant %computername%\Power Users /full /silent
:Exit
Here is what is going on:
@echo off
setacl -on "D:\test" -ot file -actn ace -ace "%computername%\administrators;p:full" /silent
setacl "D:\test" /dir /grant %computername%\Administrators /full /silent
setacl "D:\test" /dir /grant %computername%\users /write /Change /silent
setacl "D:\test" /dir /grant %computername%\Power Users /full /silent
:Exit
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
TomB
19 years ago
Posted by:
vnaumoff
19 years ago
Thanks a lot, I have used combination of Batch file with VBScript here are the results:
To create a folder use standard DOS command:
@echo off
MD D:\Test
rem Then Call VBScript from batch file: Call Share.vbs
Which looks like this:
Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = 10
strComputer ="." '(You can use Machine Name or a list of Computers or a group)
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create _
("D:\Test", "ClearCase_Reports", FILE_SHARE, _
MAXIMUM_CONNECTIONS, "ClearCase Report Folder for Developers.")
After the folder is created and shared you add permitions, in my case I had to give Full Rights to Local Users.
setacl "D:\test" /dir /grant %computername%\users /full /silent
:Exit
It works and it's silent.
To create a folder use standard DOS command:
@echo off
MD D:\Test
rem Then Call VBScript from batch file: Call Share.vbs
Which looks like this:
Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = 10
strComputer ="." '(You can use Machine Name or a list of Computers or a group)
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create _
("D:\Test", "ClearCase_Reports", FILE_SHARE, _
MAXIMUM_CONNECTIONS, "ClearCase Report Folder for Developers.")
After the folder is created and shared you add permitions, in my case I had to give Full Rights to Local Users.
setacl "D:\test" /dir /grant %computername%\users /full /silent
:Exit
It works and it's silent.
Posted by:
MSIPackager
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.