Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

delete all manually configured mapped network drives

Posted on 2009-04-23
5
Medium Priority
?
623 Views
Last Modified: 2012-05-06
Folks have gone in and manually configured mapped network drives. I created a bunch of working batch files that map the network drives and printers upon logon. They run from the sysvol folder. Each user has a set of mapped drives for them. I am just missing the line in the .bat file that deletes all of those mappings they created manually.

I used the Net Use command to map the files and printers.

Can you help me delete all manually configured mapped network drives within this batch file?

Thank you in advance for you help.
0
Comment
Question by:ChiefIT
5 Comments
 
LVL 28

Assisted Solution

by:asavener
asavener earned 920 total points
ID: 24221520
Just put "net use <driveletter> /delete" for all available drive letters before you start mapping drives:


net use f: /delete
net use g: /delete
....
net use z: /delete

net use u: \\servername\path
net use x: \\servername\path
...
0
 
LVL 86

Accepted Solution

by:
oBdA earned 1000 total points
ID: 24221827
A simple
net use * /delete /yes
at the beginning of the script will remove all mapped drive without intervention.
You might want to add
net use /persistent:no
after that, so that mapped drives aren't remembered by default.
0
 
LVL 16

Assisted Solution

by:t0t0
t0t0 earned 80 total points
ID: 24222668
Blimey! I think that just about covers it....
0
 
LVL 39

Author Closing Comment

by:ChiefIT
ID: 31574072
Sweet, thanks guys.

If you all know me, I would rather shoot myself in the foot that create scripts or batch files. So, this is a big help to me.
0
 
LVL 39

Author Comment

by:ChiefIT
ID: 24226106
So, I just woke up after a tanker of Java and about three hours sleep and find my answer. I have a new site with plenty of configuration issues that I am trying to weed out. So, bits of help like this really take some time and the edge off.

Thanks fellas. I am very passionate about hating scripts and batch files. It takes a special breed to program, I swear it. Scripting is an unfortunate evil for me in this profession. So, I really appreciate the help.

Thanks!!!

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

564 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