| |
cavalierboy
Posts: 2
Score: 0
Joined: 10/21/2008
Status: offline
|
Hi all, i'm looking for a script that will compare hostname and map drive depending of the hostname. This is what I already try and did not work. Option Explicit On Error Resume Next Dim objShell Dim regHostname Dim Hostname regHostname = "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname" Set objShell = CreateObject("WScript.Shell") ActiveComputerName = objShell.RegRead(regActiveComputerName) ComputerName = objShell.RegRead(regComputerName) Hostname = objShell.RegRead(regHostname) If Hostname = "2k3invpro01" Then objShell.NameSpace("u:").Self.Name = UCase(UserName) & " Home Drive" WScript.Quit ElseIf Hostname = "2k3cit02" Then objShell.NameSpace("u:").Self.Name = UCase(UserName) & " Home Drive" WScript.Quit ElseIf Hostname = "2k3cit03" Then objShell.NameSpace("u:").Self.Name = UCase(UserName) & " Home Drive" WScript.Quit End If Thanks for the help
_____________________________
cavalierboy
|
|