IT Management Daily
Storage Daily
Security Daily
FREE NEWSLETTERS
search
 

follow us on Twitter


internet.commerce
Be a Commerce Partner















internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers



Related Articles
User/Group Administration: Script to Map Drives using ADSI
System Administration: Script to get free space on drive

Products
 LinqConnect Express (LinqConnect Express)
 LinqConnect 2.00 (Devart)
 EMS SQL Manager for MySQL (EMS Database Management Solutions, Inc.)
 EMS SQL Management Studio for MySQL (EMS Database Management Solutions, Inc.)
 Database Designer for PostgreSQL (MicroOLAP Technologies LTD)
 ESBFinCalc Pro - Financial Calculator (ESB Consultancy)
» Enterprise IT Planet » Resources » Win Scripts

Mapping Drives

March 14, 2008

Email Print Digg This Add to del.icio.us

Want to share a script? Click here to contribute!

Author:
Donesh - donesh1 [at] gmail [dot] com

Platform:
Windows

Type:
WSH

Description:
Just as the title describes, use this script to map drives over a network.

Scroll down to view the script.


Script to map drives


Set WshShell = WScript.CreateObject("WScript.Shell") 
Set WshNetwork = WScript.CreateObject("WScript.Network") 
Set AllDrives = WshNetwork.EnumNetworkDrives() 
DriveLetter = "N:" ''must be capitalized 
RemotePath = "\\server\drive"
AlreadyConnected = False 
For i = 0 To AllDrives.Count - 1 Step 2 
If AllDrives.Item(i) = DriveLetter Then AlreadyConnected = True 
Next 
If AlreadyConnected = False then 
WShNetwork.MapNetworkDrive DriveLetter, RemotePath 
WshShell.PopUp "Drive " & DriveLetter & " connected successfully." 
Else 
WShNetwork.RemoveNetworkDrive DriveLetter 
WshShell.PopUp "Drive " & DriveLetter & " disconnected." 
End if

Disclaimer: We hope that the information in these pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by me. I shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

Email Print Digg This Add to del.icio.us

Win Scripts Archives