Disabling Wireless Driver
From: Randy Snyder (aggie07_at_austin.rr.com)
Date: 01/25/05
- Next message: Gary Chang[MSFT]: "RE: WMI provider getting PDH_CALC_NEGATIVE_DENOMINATOR from PDH"
- Previous message: alexbalaev_at_yahoo.com: "Re: Security Event Logging and remote WMI connection question"
- Next in thread: Peter Falz: "Re: Disabling Wireless Driver"
- Reply: Peter Falz: "Re: Disabling Wireless Driver"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 25 Jan 2005 01:29:12 GMT
I am trying to disable the wireless driver on notebooks. Below is the
script that I have been working with. From the MSDN documentation, the
Win32_Service is used to stop device drivers; however, I am not having
much luck getting this to work. Does anyone have any ideas?
8<-----------------------------------------
Dim sComputer : sComputer = "."
Dim sServiceName, ReturnCode, Result
Set objWMIService = GetObject("winmgmts:\\" & sComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_NetworkAdapter",,48)
For Each objItem in colItems
Result = Instr(1, Lcase(objItem.NetConnectionID), "wireless", 1)
If Result > 0 Then
sServiceName = objItem.ServiceName
End If
Next
Set WshShell = Wscript.CreateObject("WScript.Shell")
Set Locator = CreateObject("WbemScripting.SWbemLocator")
Set Services = Locator.ConnectServer(sComputer)
Set ServiceObject = Services.Get("Win32_Service='" & sServiceName & "'")
ReturnCode = ServiceObject.StopService
Wscript.Echo ReturnCode
Wscript.Quit
8<-----------------------------------------
- Next message: Gary Chang[MSFT]: "RE: WMI provider getting PDH_CALC_NEGATIVE_DENOMINATOR from PDH"
- Previous message: alexbalaev_at_yahoo.com: "Re: Security Event Logging and remote WMI connection question"
- Next in thread: Peter Falz: "Re: Disabling Wireless Driver"
- Reply: Peter Falz: "Re: Disabling Wireless Driver"
- Messages sorted by: [ date ] [ thread ]