net shareNET SHARE Command Guide - Manage Shared Resources in Windows
Learn how to use the net share command to display, create, and delete shared folders in Windows. Includes syntax, permissions, troubleshooting, and enterprise examples.
The net share command is a Windows Command Prompt utility that displays, creates, and deletes shared resources (folders and printers) on a computer. Use net share with no arguments to list all shares, or net share ShareName=Path to create a new share—essential for IT administrators managing file servers, configuring network access, and troubleshooting shared resource connectivity in enterprise environments.
Whether you're setting up a file share for a department, auditing existing shares on a server, or removing an obsolete share, net share provides command-line control over Windows file sharing. System administrators rely on this command for scripted share creation, quick audits of shared resources, and managing the administrative shares (C$, ADMIN$, IPC$) that Windows creates by default.
This comprehensive guide covers net share syntax, creating and deleting shares, permission options, practical examples for common scenarios, troubleshooting tips, related commands, and frequently asked questions. By the end, you'll confidently manage shared resources from the command line.
What Is the NET SHARE Command?
The net share command is part of the NET utility that manages network resources in Windows. It displays information about shared folders and printers, creates new shares, and deletes existing shares. NET SHARE works with the Server service; the computer must have file and printer sharing enabled.
NET SHARE is available in all Windows versions that support networking, including Windows 10, Windows 11, and Windows Server 2022. Creating and deleting shares requires administrator privileges. The command works in Command Prompt (CMD) and PowerShell. Windows creates default administrative shares (C$, ADMIN$, IPC$) automatically for management; these can be hidden but are present on domain-joined and workgroup systems.
NET SHARE Command Syntax
net share [ShareName]
net share ShareName=Drive:Path [/grant:user,permission] [/users:number] [/remark:"text"]
net share ShareName [/grant:user,permission] [/users:number] [/remark:"text"]
net share {ShareName | *} /delete
Parameters and Switches
| Parameter | Description |
|---|---|
ShareName | Name of the share (use * with /delete for all) |
Drive:Path | Local path to share |
/grant:user,permission | Grant permission: Read, Change, or Full |
/users:number | Maximum number of simultaneous users |
/remark:"text" | Description for the share |
/delete | Delete the share |
/? | Display help information |
Parameters in Detail
ShareName (Display)
When used alone, net share ShareName displays information about that share. Use net share with no arguments to list all shares on the computer.
Example: net share lists C$, ADMIN$, IPC$, and any user-created shares. Shows share name, path, and remark.
ShareName=Drive:Path (Create)
Creates a new share. ShareName is the name users will use to access the share (e.g., \computer\ShareName). Drive:Path is the local folder to share.
Example: net share Data=C:\SharedData creates a share named Data pointing to C:\SharedData. Users access it as \computername\Data.
/grant:user,permission
Sets share-level permissions when creating a share. Permissions: Read (read-only), Change (read and modify), Full (full control). Use icacls for NTFS permissions after share creation.
Example: net share Reports=C:\Reports /grant:Everyone,Read creates Reports share with read-only access for Everyone.
/delete
Removes a share. The shared folder remains on disk; only the share (network access point) is removed.
Example: net share Data /delete removes the Data share. C:\SharedData still exists locally.
Examples
Example 1: List All Shares
Scenario: You need to see all shared resources on the computer.
net share
Expected Output: Table showing Share name, Resource (path), and Remark for each share. Includes C$, ADMIN$, IPC$, and user shares.
Example 2: Create a Basic Share
Scenario: Create a share for the Finance department.
net share Finance=C:\Finance
Expected Output: "Finance was shared successfully." Users can access \computername\Finance.
Example 3: Create Share with Permission
Scenario: Create a share with read-only access for a specific group.
net share ReadOnly=C:\Public /grant:Domain Users,Read
Expected Output: Share created with Read permission for Domain Users. Users can view but not modify files.
Example 4: Create Share with User Limit
Scenario: Limit concurrent connections to 10 users.
net share Limited=C:\Limited /users:10
Expected Output: Share created. Only 10 users can connect simultaneously. Prevents overload on smaller servers.
Example 5: Create Share with Remark
Scenario: Add a description for the share.
net share Projects=C:\Projects /remark:"Project files - read/write"
Expected Output: Share created with remark visible in net share listing. Helps document share purpose.
Example 6: Delete a Share
Scenario: Remove an obsolete share.
net share OldShare /delete
Expected Output: "OldShare was deleted successfully." The folder remains; only network access is removed.
Example 7: Delete All User-Created Shares
Scenario: Remove all shares (use with caution).
net share * /delete
Expected Output: All shares deleted. Administrative shares (C$, ADMIN$) may recreate on reboot. Use with extreme caution.
Example 8: Modify Existing Share
Scenario: Change remark or user limit on existing share.
net share Finance /remark:"Updated 2026" /users:20
Expected Output: Share properties updated. Remark and user limit changed.
Common Use Cases
-
List shares for audit – Run
net shareto inventory all shared resources on a server for compliance or documentation. -
Create department share – Use
net share DeptName=C:\Pathto quickly create a share for a team or project. -
Restrict share access – Use
/grant:to set Read permission for read-only shares, preventing accidental modification. -
Limit concurrent users – Use
/users:numberon smaller servers to prevent too many simultaneous connections. -
Script share creation – Include net share in deployment scripts to create shares during server setup.
-
Remove obsolete shares – Use
net share ShareName /deletewhen decommissioning shares or migrating to new paths. -
Document share purpose – Use
/remark:to add descriptions visible in net share output; aids troubleshooting. -
Audit administrative shares – Verify C$ and ADMIN$ exist on managed servers; their absence may indicate configuration issues.
-
Create temporary shares – Use net share for quick, temporary access; delete with /delete when done.
-
Troubleshoot "cannot access share" – Run net share to verify share exists and path is correct.
-
Prepare for migration – Document shares with net share before migrating to new file server.
-
Verify share after creation – Run
net share ShareNameto confirm share was created and properties are correct.
Tips and Best Practices
-
Use descriptive share names – Choose names that indicate purpose (e.g., Finance, Projects) rather than generic names.
-
Combine with NTFS permissions – Share permissions apply at network level; use icacls for folder-level NTFS permissions. Combine both for defense in depth.
-
Document share purpose – Use /remark for every share. Future administrators will thank you.
-
Avoid spaces in share names – Use underscores or CamelCase. Spaces can cause issues in scripts and UNC paths.
-
Run as Administrator – Creating and deleting shares requires elevation. Use "Run as administrator" for CMD.
-
Verify path exists – Ensure the path exists before creating share. net share will fail if path is invalid.
-
Use /grant for least privilege – Grant Read when possible; use Change or Full only when needed.
-
Test access after creation – Use
net view \\computernameordir \\computername\shareto verify share is accessible. -
Remove shares before folder deletion – Delete share with net share /delete before removing the folder to avoid orphaned share references.
-
Audit shares regularly – Run net share periodically to identify unauthorized or obsolete shares.
Troubleshooting Common Issues
"Access is denied" When Creating Share
Problem: net share fails with access denied.
Cause: Creating shares requires administrator privileges. Standard users cannot create shares.
Solution: Right-click Command Prompt and select "Run as administrator." Ensure your account has local admin rights.
Prevention: Document that share management requires elevation. Use runas or deployment tools for non-admin scenarios.
"The shared resource does not exist"
Problem: net share reports share doesn't exist when trying to delete or modify.
Cause: Share name may be misspelled; share may have been deleted; Server service may be stopped.
Solution: Run net share to list current shares. Verify exact share name (case-insensitive but spelling matters). Check Server service: sc query LanmanServer.
Prevention: Use net share to verify share name before delete or modify operations.
"The system cannot find the path specified"
Problem: net share fails when creating share; path not found.
Cause: Path doesn't exist; typo in path; path on different drive; use of invalid characters.
Solution: Verify path with dir C:\Path. Use absolute paths. Ensure drive letter is correct. Create folder first if missing.
Prevention: Use if exist in scripts to verify path before net share. Document standard paths.
Share Created But Users Cannot Access
Problem: Share appears in net share but users get "access denied" when connecting.
Cause: NTFS permissions may be restrictive; Share permissions may limit access; firewall may block SMB.
Solution: Check NTFS permissions with icacls. Verify share permissions. Ensure Windows Firewall allows File and Printer Sharing (SMB). Check user account for proper group membership.
Prevention: Set both share and NTFS permissions during creation. Use /grant for share-level; use icacls for NTFS.
Administrative Shares (C$, ADMIN$) Missing
Problem: C$ or ADMIN$ not listed in net share.
Cause: AutoShareServer or AutoShareWks registry may be disabled; often done for "security" but breaks management tools.
Solution: Check registry: HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\AutoShareServer (and AutoShareWks). Set to 1 to enable. Restart Server service or reboot.
Prevention: Avoid disabling administrative shares unless required by policy. Many management tools depend on them.
Related Commands
net view – List Network Resources
net view displays shared resources on a computer. Use to see shares from another machine's perspective. Complements net share.
When to use: net view \\computername to list shares on a remote computer. See net view command guide.
icacls – NTFS Permissions
icacls manages NTFS permissions (read, write, execute, full control). Share permissions (net share /grant) apply at network level; icacls applies at file system level. Use both for security.
When to use: After creating share with net share, use icacls to set folder-level permissions.
net use – Map Network Drives
net use maps a drive letter to a shared folder. Use after creating share with net share to connect from client.
When to use: net use Z: \\server\share to map drive. Users connect to shares created with net share.
smb – Server Message Block
SMB is the protocol behind Windows file sharing. net share manages SMB shares. Ensure SMB is enabled (File and Printer Sharing) for shares to work.
When to use: Troubleshoot SMB connectivity when shares don't work. Check firewall and SMB settings.
Frequently Asked Questions
What does the net share command do?
NET SHARE displays, creates, and deletes shared folders (and printers) on a Windows computer. Use net share to list shares, net share Name=Path to create, and net share Name /delete to remove. Essential for managing network file sharing.
How do I list all shared folders?
Run net share with no arguments. Output shows share name, local path (resource), and remark for each share. Includes default administrative shares (C$, ADMIN$, IPC$).
How do I create a shared folder?
Use net share ShareName=Drive:Path. Example: net share Data=C:\SharedData creates a share named Data. Users access as \computername\Data. Requires administrator privileges.
How do I delete a shared folder?
Use net share ShareName /delete. Example: net share Data /delete removes the Data share. The folder remains on disk; only network access is removed.
What are C$ and ADMIN$?
C$ and ADMIN$ are default administrative shares. C$ shares the root of the C: drive; ADMIN$ shares the Windows folder. They're hidden (no $ in browse) and require administrator credentials. Used for remote administration.
What is the difference between share permissions and NTFS permissions?
Share permissions (set with /grant) apply when accessing over network. NTFS permissions (set with icacls) apply at file system level. Both apply when accessing over network; most restrictive wins. Use both for security.
Can I set permissions when creating a share?
Yes. Use /grant:user,permission where permission is Read, Change, or Full. Example: net share Data=C:\Data /grant:Everyone,Read creates read-only share.
Why can't users access my share?
Check: (1) Share exists (net share), (2) NTFS permissions allow access (icacls), (3) Share permissions allow access (/grant), (4) Firewall allows SMB, (5) User has correct network path (\server\share).
How do I limit the number of users on a share?
Use /users:number when creating: net share Data=C:\Data /users:10. Limits to 10 simultaneous connections. Useful for licensing or performance.
Can net share create shares on a remote computer?
No. NET SHARE manages shares on the local computer only. To manage remote shares, use PowerShell (New-SmbShare), WMI, or run net share on the remote computer via PsExec or similar.
Quick Reference Card
| Command | Purpose | Example Use Case |
|---|---|---|
net share | List all shares | Audit shared resources |
net share Data=C:\Data | Create share | Share folder |
net share Data=C:\Data /grant:Users,Read | Create share with permission | Read-only share |
net share Data /delete | Delete share | Remove share |
net share Data /remark:"Description" | Add/change remark | Document share |
net share Data /users:10 | Set user limit | Limit connections |
Try the NET SHARE Command in Our Simulator
Practice the net share command safely in our Windows Command Simulator. Explore net view for listing shares on remote computers, the Commands Reference for all Windows CMD utilities, and gpupdate for Group Policy management.
Summary
The net share command manages shared resources in Windows. Use net share to list shares, net share Name=Path to create, and net share Name /delete to remove. Combine /grant for permissions, /users for connection limits, and /remark for documentation. Run as Administrator for create/delete operations. Remember: share permissions apply at network level; use icacls for NTFS permissions. Master net share for efficient file server management and network resource administration.