VBS  VBA Word  VBA Excel  VBA Access  VB 6.0  Registry key  Java Script  CMD  ASP 
 

  
Add Template to rightclick
AddGlobalGroupToLocal
AddToLocalAdm
AddWindowsPrinter
ArangeWindows
Caluclate
cert
ChPermisionOnFiles
Create entry in Saplogon.ini
DisarmScreensaver
Enumerate computer accounts
enumerate domains
Enumerate groups
Enumerate sorftware
Enumerate user accounts
Environment var
Get WSH Version
GetPCName
GetUserName
GroupMembership.vbs
Identify OS
ListAddRemovePrograms
Logoff
MapDrv
MonitorApp
Progress_bar
Read in file
ReadDiffOSRegKey
Reboot
Require a Password Change
SendMail
SetPassword
Start_serviceses
Track Script In Browser
UnlockUserAccount
UserIsLogedOnPCName
Write to Event Log
  Home    Logbook    Photos    Links    Tools    Scripts 

MapDrv

Here's a script that lets you map and un-map a network drive with just one click:
'Here's an example of a more complex script. 
'Let's say you use a portable computer that is sometimes connected to a local-area network. 
'While the process of mapping and disconnecting a network drive is not difficult, it can be tedious to do repeatedly. 

Set WshShell = WScript.CreateObject("WScript.Shell") 
Set WshNetwork = WScript.CreateObject("WScript.Network") 
Set AllDrives = WshNetwork.EnumNetworkDrives() 
DriveLetter = "N:" ' must be CAP
RemotePath = "\\MAXI\c$" 

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 
Msgbox "Drive " & DriveLetter & " connected successfully." 

Else 
WShNetwork.RemoveNetworkDrive DriveLetter 
Msgbox "Drive " & DriveLetter & " disconnected." 
End if			   


Bookmark this page Danmarks Meteorologiske institut Dansk Drageflyver Union Check out MySpace Looking for somthing?