Solved

Network Share Permissions (Command)

Posted on 2006-06-14
7
319 Views
Last Modified: 2010-08-05
Hi Everybody,

I want to make a batch file that shares and give some permissions to a folder. Right now I have:

net share C$ /delete
net share shared=C:\stuff_to_share /users:2

This effectively shares the folder c:\stuff_to_share, but it gives permissions to everybody (read only, since I'm in XP SP2), but I want to remove the Everybody permission and give specific access to some people.

Of course, it most be a command, not through the Windows GUI.

I looked the CACLS command, but it seems to affect only the local Access List, not the Shared ones.

Any advice is welcome. Thanks in advance.
0
Comment
Question by:favelill
  • 4
  • 2
7 Comments
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16903198
Share permissions are a bit on the pointless side.  I ALMOST never set them - use NTFS (CACLS) that applies all the time.
0
 

Author Comment

by:favelill
ID: 16904000
I already review the CACLS (as noted above), but it seams to apply only the Local Access Control Lists. How do you use it to give Network Permissions?
0
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 125 total points
ID: 16904555
As I said, Share permissions are a bit on the pointless side.  Use NTFS permissions.

Share permissions ONLY apply to a top level folder and then ONLY when accessed via the Network - NTFS permissions can be customized PER file/folder AND They DO apply even when logged on locally - share permissions do not.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16904576
http://www.windowsitpro.com/Article/ArticleID/14459/14459.html?Ad=1

There are some links here for setting share permissions - but I can't say it enough - most admins DO NOT MODIFY the share permissions because they are pointless.

http://www.codecomments.com/archive299-2005-1-341762.html
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 16905992
"net share C$ /delete"
BTW that will ony delete the C$ share untill the computer is restarted. Windows automatically recreates it.

If for whatever reason you do want to remove the C$ share permanently, you need to also edit the registry.
http://www.petri.co.il/disable_administrative_shares.htm
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16906393
> net share C$ /delete
Somehow I missed that

> Any advice is welcome. Thanks in advance.
DO NOT stop sharing the C$ share - this is an administrative that can be an invaluable resource in systems management.  Only admins can access it so your users don't have rights to it.

You CAN follow the link Kenneniah provided, but my advice is NOT TO DO THIS.

Maybe you have your reasons - but without knowing them, this is the BEST advice I can provide.

0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 16906474
I agree that removing the C$ share is pointless. It's easy for any admistrator to get around anyway, as they can always use computer management among many other tools to connect and create a share anyway.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows XP image 11 116
Check network connectivity in DOS 11 114
HP PC Hardware Diagnostics UEFI 11 135
Windows 7 Share with XP 22 178
Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question