Removing Shares via the CLI

Discussion in 'Windows 7 / 8 /10 Client Exams' started by ScoobyDoo, Nov 13, 2008.

  1. ScoobyDoo

    ScoobyDoo Byte Poster

    103
    3
    15
    Hi,

    Does anybody know how to remove all printer & folder shares on an XP PC using the CLI. I have tried the RMTShare command - but this only allows you to removed specific named shares.

    Thanks

    SD
     
    Certifications: <<See Below>>
  2. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,878
    181
    256
    net stop server :)
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  3. Sparky
    Highly Decorated Member Award 500 Likes Award

    Sparky Zettabyte Poster Moderator

    10,718
    543
    364
    For the shares...

    net use /delete * /y
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) MS-900 AZ-900 Security+ Network+ A+
    WIP: Microsoft Certs
  4. ScoobyDoo

    ScoobyDoo Byte Poster

    103
    3
    15
    I am looking to delete all shared folders & printers from a PC via a script. This allows a fresh base for others to start setting them up again.
     
    Certifications: <<See Below>>
  5. BosonMichael
    Honorary Member Highly Decorated Member Award 500 Likes Award

    BosonMichael Yottabyte Poster

    19,183
    500
    414
    Uh... your question has been answered. :)
     
    Certifications: CISSP, MCSE+I, MCSE: Security, MCSE: Messaging, MCDST, MCDBA, MCTS, OCP, CCNP, CCDP, CCNA Security, CCNA Voice, CNE, SCSA, Security+, Linux+, Server+, Network+, A+
    WIP: Just about everything!
  6. ScoobyDoo

    ScoobyDoo Byte Poster

    103
    3
    15
    Hi,

    I really do appreciate the replies so far, but these commands don't do what I want. Both of them will effectively sever the links on one PC to shared resources on another. What I need to do is make shared printers & files on a PC unshared. The CLI equivalent of removing all the entries in Computer - Management - Shared Folders - Shares. I also need similar for printers.

    As ever, all help appreciated.
     
    Certifications: <<See Below>>
  7. BosonMichael
    Honorary Member Highly Decorated Member Award 500 Likes Award

    BosonMichael Yottabyte Poster

    19,183
    500
    414
    Uninstall and reinstall File and Print Sharing. Uninstalling it removes your shares. When you reinstall it, the only shares that remain are the default ADMIN$, C$ (and other driveletter$ shares), and IPC$.

    There's probably a way to script that out...
     
    Certifications: CISSP, MCSE+I, MCSE: Security, MCSE: Messaging, MCDST, MCDBA, MCTS, OCP, CCNP, CCDP, CCNA Security, CCNA Voice, CNE, SCSA, Security+, Linux+, Server+, Network+, A+
    WIP: Just about everything!

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.