/build/static/layout/Breadcrumb_cap_w.png

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

0 Comments   [ + ] Show comments

Answers (3)

Posted by: TomB 18 years ago
Orange Belt
0
You can try RMTShare.exe. It is found in the Windows NT Resource Kit and works on Windows 2000 and 2003.

See here for more details:
http://www.ss64.com/nt/rmtshare.html

and here:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarexnt01/html/ewnt.asp
Posted by: vnaumoff 18 years ago
Senior Yellow Belt
0
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.
Posted by: MSIPackager 18 years ago
3rd Degree Black Belt
0
I thought you wanted to set permissions on the share you create?

It seems not though so I guess you could have just used the net share command in your batch file and skip the vb script..?

Might have been easier but if it works it works... [;)] Or am I missing something?

Cheers,
Rob.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ