I would stay away from using the model number of the computer. Dell uses standard NIC cards and the drivers are, for the most part, the same for each NIC type. Here is a script similiar to the one above but this one checks for the presence of an Intel 2200 or 3945 wireless adapter. They use the same driver. I made an administrative installation of the Intel ProSet to the latest version (10.5.1.0 right now). You could easily modify it. My script will also e-mail me if it fails.
Sub IntelWireless()
on error resume next
Set filesys = CreateObject("Scripting.FileSystemObject")
Set ProgFiles = WScript.CreateObject ("WScript.Shell")
Set WshShell = WScript.CreateObject ("WScript.Shell")
MajVer = 10
MinVer = 5
Build = 1
baseInstall = "\\filesrv01\sms$\Intel Proset 10.5.1\IntelSetup.exe"
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter",,48)
For Each objNIC in colItems
pos3945 = InStr(objNIC.Name,"3945ABG")
pos2200 = InStr(objNIC.Name,"2200BG")
if pos3945 <> "0" or pos2200 <> "0" then
' \\ If an adapter exists, echo that it exists.
'wscript.echo "Intel NIC Exists"
IntelExists = "True"
end if
Next
If IntelExists = "True" then
If filesys.FileExists(ProgFiles.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Intel\Wireless\Drivers\iProDifx.dll") then
MyArray = Split(filesys.GetFileVersion(ProgFiles.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Intel\Wireless\Drivers\iProDifx.dll"),".")
' wScript.echo MyArray(0)
' wScript.echo MyArray(1)
' wScript.echo MyArray(2)
' wScript.echo MyArray(3)
MajVersion = CInt(MyArray(0))
' Wscript.echo MajVersion
MinVersion = CInt(MyArray(1))
BuildNum = CInt(MyArray(2))
If MajVersion < MajVer or MinVersion < MinVer or BuildNum < Build then
Set WshShell = CreateObject("WScript.Shell")
WshShell.Popup "Your system has an older version of the Intel Proset Software (for the Intel Wireless NIC Card) on your system." _
& vbCRLF & vbCRLF & "Press OK to update the driver. Please be patient as the install file is quite large (50 MB)!" & vbCRLF & vbCRLF _
& " ---- IT Department" & vbCRLF & vbCRLF _
& "Currently Installed Version: " & MajVersion & "." & MinVersion & "." & BuildNum & vbCRLF & vbCRLF _
& "Version to be Installed: " & MajVer & "." & MinVer & "." & Build,15,"Dell Quickset is out of Date!",48
'Wscript.echo BaseInstPath
' \\ Copy the install file to the %temp% directory for install. It will not work over the network.
filesys.CopyFile baseInstall, ProgFiles.ExpandEnvironmentStrings("%TEMP%" & "\IntelSetup.exe"),True
WshShell.Run (ProgFiles.ExpandEnvironmentStrings("%TEMP%") & "\IntelSetup.exe"),1,True
End If
else
' \\ Install Intel Software
filesys.CopyFile baseInstall, ProgFiles.ExpandEnvironmentStrings("%TEMP%" & "\IntelSetup.exe"),True
WshShell.Run (ProgFiles.ExpandEnvironmentStrings("%TEMP%") & "\IntelSetup.exe"),1,True
End If
End If
If err.number <> 0 then
call sendMail("Script error in Intel Wireless installation routine of os.vbs",vbCRLF & vbCRLF & "This user had an error while in the Intel wireless" & vbCRLF & vbCRLF & "Current Error = " & Err.Number)
End if
on error goto 0
End Sub
Sub sendMail (mailSubject,mailBody)
Set objEmail = CreateObject("CDO.Message")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject ("WScript.Shell")
computerName = objShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
userName = objShell.ExpandEnvironmentStrings("%USERNAME%")
if computerName = "WORKSTATIONXP" or computerName = "WORKSTATION2XP" then
exit sub
end if
objEmail.From = userName & "@somedomain.com"
objEmail.To = "Support@somedomain.com"
objEmail.Subject = mailSubject
objEmail.Textbody = "User: " & userName & " on computer \\" & computerName & " " & mailBody
objEmail.Configuration.Fields.Item _
("
= 2
objEmail.Configuration.Fields.Item _
("
= _
"smtp.somedomain.com"
objEmail.Configuration.Fields.Item _
("
= 25
objEmail.Configuration.Fields.Update
objEmail.Send
End Sub
It is what it is!!
__________________________________
A+, Net+, I-Net+, Certified Web Master, MCP, MCSA, MCSE, CCNA, CCDA, and few others (I got bored one day)