Avatar of cdmt00
cdmt00
Flag for United States of America asked on

How do I undo a shared drive in batch files.

I am currently using the command "net use k: \\server\share" as a .bat login script in AD and am wondering if there is anyway that I can use a logoff script and unuse the shared drive mapping.
Windows BatchWindows Server 2003Scripting Languages

Avatar of undefined
Last Comment
Brian Pierce

8/22/2022 - Mon
Brian Pierce

net use k: \\server\share /delete
sk_raja_raja

do you push this scrip through GPO ?
Brian Pierce

you can assign it as a logoff script with a GPO (in the same way as you can set a logon script with a GPO

see http://www.serverwatch.com/tutorials/article.php/1474241
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
SOLUTION
tigermatt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
cdmt00

ASKER
so is it

net use k: \\server\share /delete

or

net use k: /delete
cdmt00

ASKER
net use k: /delete
ASKER CERTIFIED SOLUTION
kollar_fr

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
tigermatt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Brian Pierce

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.