Solved

Network Share Permissions (Command)

Posted on 2006-06-14
7
317 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now