[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

logon/logoff script to disconnect all network drives?

Posted on 2005-05-09
6
Medium Priority
?
1,004 Views
Last Modified: 2008-01-16
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
0
Comment
Question by:pauljnye
  • 2
  • 2
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
zkrieger earned 2000 total points
ID: 13962769
NET USE * /DELETE /YES
0
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13962794
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
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13962799
good tip zkrieger
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:pauljnye
ID: 13963367
So by inserting      NET USE * /DELETE /YES    this will cause ALL drives to be disconnected?

Paul
0
 
LVL 6

Expert Comment

by:zkrieger
ID: 13965019
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
 

Author Comment

by:pauljnye
ID: 13965106
works great!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Loops Section Overview

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question