PEZ said:
Anyone point me in the direction of how to script an unattended
install of the client for M$ networks?
I have 1500 workstations (2K and XP) that will soon need it,
and don't really want to manually install on each machine.
Hi,
Only way I know about, is to use snetcfg.exe:
C:\>snetcfg.exe -v -l %windir%\Inf\Netmscli.inf -c c -i ms_msclient
Trying to install 'ms_msclient'...
....done
*** You need to reboot your computer for this change to take effect ***
C:\>_
Snetcfg is a sample tool in the MS Driver Development Kit
(...\src\network\config\netcfg) that must be compiled into an exe from
the source (C/C++?) before it can be used. It can list, install and
uninstall most network components (note: Win2k and WinXP only).
More about MS Driver Development Kit here:
http://www.microsoft.com/whdc/devtools/ddk/default.mspx
Fortunately, you can download a compiled version of Snetcfg.exe (note
DIFFERENT version depending on OS) at
http://www.jsiinc.com/reghack.htm, tip 4705
Here is a VBScript that should do the job:
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
SetLocale "en-us" ' do not remove
If GetOsVersionNumber = 5 Then
sSnetcfgPath = "some path to snetcfg.exe for Windows 2000 here"
Elseif GetOsVersionNumber = 5.1 Then
sSnetcfgPath = "some path to snetcfg.exe for Windows XP here"
Else
' unsupported OS
WScript.Quit
End If
sInstCmd = Chr(34) & sSnetcfgPath & Chr(34) & " -l " _
& "%windir%\Inf\Netmscli.inf -c c -i ms_msclient"
oShell.Run sInstCmd, 0, True
MsgBox "Installation of Client for Microsoft Networks is finished," _
& " reboot needed.", vbInformation + vbSystemModal, "Client installation"
Function GetOsVersionNumber()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Determines OS by reading reg val & comparing to known values
' OS version number returned as:
' Windows 9X: 0
' Windows NT4: 4
' Windows 2k: 5
' Windows XP: 5.1
' Windows 2003: 5.2
' Windows x: >5.2
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim oShell, sOStype, sOSversion, GetOsVersionNumberReg
Set oShell = CreateObject("Wscript.Shell")
'On Error Resume Next
sOStype = oShell.RegRead(_
"HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType")
If Err.Number<>0 Then
' Hex(Err.Number)="80070002"
' - Could not find this key, OS must be Win9x
Err.Clear
GetOsVersionNumber = 0
Exit Function ' >>>
End If
GetOsVersionNumberReg = oShell.RegRead(_
"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
If Err.Number<>0 Then
GetOsVersionNumber = "Unknown NTx"
' Could not determine NT version
Exit Function ' >>>
End If
SetLocale "en-us" ' do not remove
GetOsVersionNumber = CSng(GetOsVersionNumberReg)
If GetOsVersionNumber > 49 Then
GetOsVersionNumber = CSng(Replace(GetOsVersionNumberReg, ".", ","))
End If
End Function
'--------------------8<----------------------