logon/logoff script to disconnect all network drives?

Is there a simple way for my logoff script to disconnect all mapped network drives in one command?  I know the long way would be to have one line inthe script for all possible drive letters, but that would be cumbersome and slow

Paul
pauljnyeAsked:
Who is Participating?
 
zkriegerConnect With a Mentor Commented:
NET USE * /DELETE /YES
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Assuming you can use a batch script, simple way is to add this line to a batch file:

for /f "tokens=2" %%a in ('net use ^| find "\\"') do NET USE %%a /delete
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
good tip zkrieger
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
pauljnyeAuthor Commented:
So by inserting      NET USE * /DELETE /YES    this will cause ALL drives to be disconnected?

Paul
0
 
zkriegerCommented:
yes, net use * means all connections. /delete means to delete the connections, and /yes answers the yes/no prompt so your batch file doesnt pause to wait for your reply.
0
 
pauljnyeAuthor Commented:
works great!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.