4

We have an extern computer in our office and sometimes we need to connect it to some shared folders in our network. but afterwards we want to delete its connection. Right now we restart the machine, but I want to find out, if there is a more practical solution.

My shared folder which I want to connect and remove afterwards

after some research I found out that net use does things like remove remote drives with the command

net use X: \delete

But for a shared folder I do not have a drive letter. Can I use net use to detach the connection to a shared folder, so that I have to add in the username and password again when I want to reconnect?

Or is there a different approach than net use

2 Answers 2

4

Try net use \\Computer\Sharename /delete. You'll have to remove all shares to a single computer/server in order to log on again (net use /user:...). You can also use net use * /delete to disconnect all shares from a client.

2
  • Thank you very much. in my troubleshooting phase I wrote \delete instead of /delete. I assume, that I can write \\Computer* /delete.
    – monatsend
    Dec 13, 2017 at 12:26
  • OK, unfortunately, " \\Computer* /delete " is not possible
    – monatsend
    Dec 13, 2017 at 15:07
1

Can I use net use to detach the connection to a shared folder, so that I have to add in the username and password again when I want to reconnect?

Yes. As Zac67 stated in his comment, you can run net use \Computer\Sharename /delete or net use * /delete to delete connections to one or all shared folders.

2
  • Thank you too. Good that the /delete command removes every login credentials. That's exactly what I need
    – monatsend
    Dec 13, 2017 at 12:29
  • 1
    To be exact, net use /delete removes the login session. If you've stored login credentials in your user profile, these are not removed (but can be overridden by net use /user:....
    – Zac67
    Dec 13, 2017 at 17:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .