Delete network mapped drive and map network shared folder.

You can use this script to remove existing mapped shared folder and add new shared folder. You can modify the script if you don’t need to delete and simply just add another one or as much as you like.

@echo off

rem Remove the network shared folder
net use [network shared folder] /delete

rem Map the network shared folder
net use [network shared folder] [mapping path]

To use this script, simply replace [network shared folder] and [mapping path] with the appropriate values for your system. For example, if you wanted to remove the network shared folder \\server\share and map it to the local path M:\, you would use the following script:

@echo off

rem Remove the network shared folder
net use \\server\share /delete

rem Map the network shared folder
net use \\server\share M:\

Leave a Comment

Your email address will not be published. Required fields are marked *