1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Removing Shares via the CLI

Discussion in 'Windows Vista / 7 / 8 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,871
    167
    256
    net stop server :)
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  3. Sparky
    Highly Decorated Member Award

    Sparky Zettabyte Poster Moderator

    10,191
    296
    319
    For the shares...

    net use /delete * /y
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) Security+ Network+ A+
    WIP: Exchange 2007\2010
  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
    Highly Decorated Member Award

    BosonMichael Yottabyte Poster

    19,136
    462
    374
    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
    Highly Decorated Member Award

    BosonMichael Yottabyte Poster

    19,136
    462
    374
    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...