What is the 'share' command in the Windows command line?

Welcome Delta Sigma Pi

  • Accessibility
  • Sales:

    Home:

    1-800-426-7235

    Business:

    1-866-426-0911

    Chat Now >

    Visit Sales Support Page >


    Order Support:

    Order Lookup >

    Visit Order Support Page >

    Technical Support >

Lenovo
All
  • All
  • Laptops
  • Desktops
  • Workstations
  • Monitors
  • PC Accessories & Electronics
  • Tablets
  • Servers & Storage
  • Servers Accessories
  • Sign In / Create Account
    My Lenovo Account
    Keep track of your wishlist, orders, and rewards all in one place
    Sign In / Create Account
    Welcome Back!
    Access your order, subscriptions, saved carts, rewards balance, and profile
    View My Account
    Orders
    View & track your orders
    Rewards
    Earn & redeem Rewards
    Profile
    Edit name, password, and account settings
    Wishlist
    Manage a wishlist of your favorite products
    Products
    Manage your devices, accessories
    Product Registration
    Register your product and/or update your warranty dates
    Sign Out
  • My Lenovo Rewards
  • Cart
  • Products
  • Solutions
  • Services
  • Support
  • About Lenovo
  • Deals
  • Student
  • Gaming
  • AI
  • Digital Workplace
  • Hybrid Cloud
  • Edge
  • Sustainability
  • TruScale
  • Solutions by Industry
  • Alliance Partners
  • Other Solutions
  • Resources
TEMPORARILY UNAVAILABLE
DISCONTINUED
Temporary Unavailable
Cooming Soon!
. Additional units will be charged at the non-eCoupon price. Purchase additional now
We're sorry, the maximum quantity you are able to buy at this amazing eCoupon price is
Sign in or Create an Account to Save Your Cart!
Sign in or Create an Account to Join Rewards
View Cart
Remove
Your cart is empty! Don’t miss out on the latest products and savings — find your next favorite laptop, PC, or accessory today.
item(s) in cart
Some items in your cart are no longer available. Please visit cart for more details.
has been deleted
Please review your cart as items have changed.
of
Contains Add-ons
Subtotal
Proceed to Checkout
Yes
No
Popular Searches
What are you looking for today ?
Trending
Recent Searches
Items
All
Cancel
Top Suggestions
View All >
Starting at
  • Black Friday in July! Limited-time Doorbusters + Buy more, Save more!  Shop Now >

  • My Lenovo Rewards! Earn 3%-9% in rewards and get free expedited delivery on select products. Join for Free >

  • Buy online, pick up select products at Best Buy. Shop Pick Up >

  • Lease-to-own today with Katapult. Get started with an initial lease payment as low as $1! * Learn More >

Home > Glossary >What is the `share` command in the Windows command line?
Glossary Hero
Learn More
StarStar

Annual Sale

Lenovo Laptop SaleLenovo Laptop Sale

Laptop Deals

Desktop DealsDesktop Deals

Desktop Deals

Workstation DealsWorkstation Deals

Workstation Deals

StoreStore

Pick Up Today at Best Buy

ControllerController

Gaming PC & Accessory Deals

MouseMouse

PC Accessories & Electronics Deals

MonitorMonitor

Monitor Deals

Tablet and phoneTablet and phone

Tablets & Phones Deals

ServerServer

Server & Storage Deals

Discount tagDiscount tag

Clearance Sale


What is the 'share' command in the Windows command line?

The ‘share’ command in the Windows command line is used to manage shared folders on a network. It allows you to create, modify, and delete shared folders, as well as set permissions for who can access them.

How do I create a shared folder using the windows command line?

To create a shared folder using the windows command line, you would use the net share command. Open Command Prompt with administrative privileges and type net share [sharename]=[path], where [sharename] is the name, you want to give the share, and [path] is the path to the folder. For example, net share MyShare=C:\Users\Public\Documents\SharedFolder will share the specified folder with the name "MyShare". This command sets up the share, making it accessible to network users depending on the permissions you set.

Can I view existing shares on my computer using the command line?

Yes, you can view existing shares on your computer using the command line. Open Command Prompt and type net share. This command will display a list of all currently shared resources on your machine, including their names, paths, and descriptions. It is a quick way to audit your shares and ensure everything is set up correctly. You can see which folders are shared and manage them as needed, all from the command line interface.

How can I remove a shared folder using the windows command line?

Removing a shared folder using the windows command line is straightforward. Open Command Prompt with administrative privileges and use the net share [sharename] /delete command, replacing [sharename] with the name of the share you want to remove. For example, net share MyShare /delete will stop sharing the folder named "MyShare". This command removes the share from your computer, ensuring that it is no longer accessible over the network.

Does the command line allow setting permissions on shared folders?

Yes, the command line allows you to set permissions on shared folders using the net share command. When you create or modify a share, you can specify permissions with the /grant option. For instance, net share MyShare=C:\SharedFolder /grant:Everyone, full grants full access to everyone. Adjusting permissions directly through the command line is powerful for managing access control in networked environments, ensuring only authorized users can interact with shared resources.

How do I map a network drive using the Windows command line?

Mapping a network drive using the Windows command line involves the net use command. Open Command Prompt and type net use [drive_letter]: \\[server]\[share], where [drive_letter] is the drive letter you want to assign, [server] is the name of the server, and [share] is the name of the shared resource. For example, net use Z: \\Server\SharedFolder maps the shared folder to the Z: drive on your computer. This command connects you to a network resource, making it accessible like a local drive.

What is the difference between net share and net use commands?

The net share command is used to create, manage, and delete shared resources on your computer, making files or printers accessible over the network. On the other hand, the net use command is used to connect to shared resources on other computers, mapping network drives or connecting to shared printers. Net share is focused on sharing your resources, while net use is about accessing resources that are shared by others.

Can I automate the sharing of folders using a script?

You can automate the sharing of folders using batch scripts (.bat files). By incorporating net share commands into a script, you can streamline the process of setting up shares. For example, create a text file with commands like net share MyShare=C:\SharedFolder /grant:Everyone,full, save it with a .bat extension, and run the script. This approach is particularly useful for quickly setting up multiple shares or deploying shared resources across multiple machines in a network.

Could sharing files via command line improve security?

Sharing files via the command line can indeed improve security, as it allows for precise control over what gets shared and with whom. By using commands like net share and setting specific permissions, you can ensure that only authorized users have access. Additionally, managing shares through scripts can help standardize security settings across multiple machines, reducing the risk of misconfigurations that could lead to unauthorized access or data breaches.

When should I use the command line to manage shares instead of a GUI?

Using the command line to manage shares is particularly beneficial when you need to automate tasks, manage shares on multiple machines, or perform actions remotely. Command line tools offer greater flexibility and precision, especially for administrators who need to script and schedule share management tasks. While GUIs are user-friendly for occasional use, the command line is a powerful tool for consistent, large-scale, or repetitive share management tasks.

How do I stop sharing a folder temporarily using the command line?

To stop sharing a folder temporarily using the command line, you can delete the share and recreate it later. Use the net share [sharename] /delete command to remove the share. When you are ready to share the folder again, use the net share [sharename]=[path] command to set it up. Although this method involves re-creating the share, it ensures that the folder is not accessible over the network during the period when sharing is stopped.

Could I use the Windows command line to share a folder with specific users only?

Yes, you can share a folder with specific users only using the windows command line by setting permissions. Use the net share command with the /grant option to specify user access levels. For example, net share MyShare=C:\SharedFolder /grant: User1, read /grant: User2, full grants read access to User1 and full access to User2. This approach ensures that only designated users can access the shared folder, enhancing security and control over your network resources.

Could I list shared folders on a remote computer using the command line?

Yes, you can list shared folders on a remote computer using the command line. Open Command Prompt and use the net view \\[computername] command, replacing [computername] with the name or IP (Internet Protocol) address of the remote computer. This command displays a list of shared resources on the specified machine. It is a helpful way to see what is being shared across your network, allowing you to verify and manage shared resources on remote computers without needing physical access.

How do I share a folder with read-only access using the command line?

To share a folder with read-only access using the command line, use the net share command with the /grant option to specify read permissions. For example, net share ReadOnlyShare=C:\SharedFolder /grant:Everyone,read shares the folder with read-only access for all users. This setup ensures that users can view and read files in the shared folder but cannot modify or delete them, providing a secure way to distribute information without risking data integrity.

Can I share my documents with someone who uses a different operating system?

Yes, you can share your documents with someone using a different operating system. Modern sharing platforms and cloud services are designed to be cross-platform, which means they work across various operating systems. All you need is an internet connection and access to a common platform where both parties can upload, access, and download files as needed.

Can share folders be synchronized across devices automatically?

Yes, many cloud services offer the feature to automatically synchronize share folders across multiple devices. When you add, delete, or modify files in a share folder, the changes are automatically updated and reflected across all devices linked to your cloud account. This ensures that you and your collaborators always have access to the latest versions of files.

Looking for a Great Deal?
Shop Lenovo.com for great deals on A+ Education PCs, Accessories, Bundles and more.
Shop Deals Now

  • Legion 7i Gen 9 (16″ Intel) Gaming Laptop
    Starting at
    $1,699.99
    Learn More
  • ThinkPad X9 15 Aura Edition (15ʺ Intel) Laptop
    Starting at
    $1,127.97
    Learn More
  • Yoga Book 9i (13” Intel)
    Starting at
    $1,999.99
    Learn More
  • Legion 5i Gen 9 (16″ Intel) Gaming Laptop
    Starting at
    $1,415.49
    Learn More
  • Yoga 9i 2-in-1 Aura Edition (14″ Intel) Laptop
    Starting at
    $1,439.99
    Learn More
  • Shop
    • Student Deals
    • K-12 Student Laptops
    • Student Accessories
    • Laptops by Major
    Education resource
    Explore
    • What is STEM?
    • Best Laptops for College
    • Student & Teacher Discounts
    • Lenovo Sustainability Programs
    Education carry case

    Stem Articles
    See All STEM Articles
    • Online STEM Education

    • STEM Career Tips & Resources

    • Women in STEM

    • STEM Educator Training

    • STEM Grants & Funding

    • STEM Education: Coding for Kids

    • STEM Education: Robotics

    • STEM Education: Biotechnology

    • STEM Education: Sustainability

    • STEM Education: AI & ML

    While every effort has been made to ensure accuracy, this glossary is provided for reference purposes only and may contain errors or inaccuracies. It serves as a general resource for understanding commonly used terms and concepts. For precise information or assistance regarding our products, we recommend visiting our dedicated support site, where our team is readily available to address any questions or concerns you may have.

    Why Lenovo?

    Go Greener with Leno...

    Lenovo is committed to Smarter Climate Action with lower energy laptops, use of sustainable materials and packaging, and available CO2 Offset Services.
    Learn More
    pastel background

    Get It Now, Pay For ...

    Lenovo has multiple financing option: the Lenovo Credit Card, installment plans, and lease-to-own financing op...
    Learn More
    pastel background

    Productivity & Peace of Mind

    Stay productive with Premium Care Plus - 24/7 priority support and coverage against accidental damage. Power through your day with our Smart Performance and extended battery solutions.
    Learn More
    pastel background

    Fast & Secure

    Get the most from your laptop with Lenovo’s state-of-the-art Smart Performance, delivering powerful, all-in-on...
    Learn More
    pastel background

    Assistance and Suppo...

    Chat with a trained professional who can help you find the right products, place or check on an order, or setup your Education laptop.
    Contact Us
    pastel background
    Enter email to receive Lenovo marketing and promotional emails. Review our Privacy Statement for more details.
    Please enter the correct email address!
    Email address is required
    • Facebook
    • Twitter
    • Youtube
    • Pinterest
    • TikTok
    • Instagram
    Select Country / Region:
    Country
    AndroidIOS

    About Lenovo

    • Our Company
    • News
    • Investors Relations
    • Compliance
    • ESG
    • Product Recycling
    • Product Security
    • Product Recalls
    • Executive Briefing Center
    • Lenovo Cares
    • Careers
    • Formula 1 Partnership

    Products & Services

    • Laptops & Ultrabooks
    • Smarter AI for You
    • Desktop Computers
    • Workstations
    • Gaming
    • Tablets
    • Servers, Storage, & Networking
    • Accessories & Software
    • Services & Warranty
    • Product FAQs
    • Outlet
    • Deals
    • Lenovo Coupons
    • Cloud Security Software
    • Windows 11 Upgrade

    Resources

    • Legion Gaming Community
    • Lenovo EDU Community
    • Lenovo Pro Community
    • Lenovo Pro for Business
    • My Lenovo Rewards
    • Lenovo Financing
    • Lenovo Trade-in
    • Affiliate Program
    • Affinity Program
    • Employee Purchase Program
    • Lenovo Partner Hub
    • Laptop Buying Guide
    • Where to Buy
    • Glossary

    Customer Support

    • Contact Us
    • Policy FAQs
    • Return Policy
    • Shipping Information
    • Order Lookup
    • Register a Product
    • Replacement Parts
    • Technical Support
    • Forums
    • Provide Feedback
    © 2025 Lenovo. All rights reserved.
    PrivacyCookie Consent ToolSite MapTerms of UseExternal Submission PolicySales terms and conditionsAnti-Slavery and Human Trafficking Statement
    Compare  ()
    x
    Call

    Need Help? Call: 

    1-800-426-7235
    Select Your Store
    Add items to your cart?
    We've noticed that you've entered a different store. Do you want to add these items to your cart in the new store?
    No Yes. Add in Lenovo Pro

    close_icon

    Sign up and receive up to $100
    off your next purchase.
    Click here for offer details
    Are you shopping for a business?

    No, Thanks

    Click here for offer details
    *Offer valid for new subscribers only. Not valid on previous purchases.
    Lenovo Privacy Policy
    Thanks for signing up!
    You should receive an email from us within the next 2 hours
    *Offer valid for new subscribers only. Not valid on previous purchases.
    Lenovo Privacy Policy
    An error occurred while submitting your request.
    Please try again later.