It depends on what you are trying to disable. If you are trying to disable LAN network interfaces then the only possibility on XP-machines (as far as I know) to do this programatically is using devcon.exe
(a program that is like the device manager commandlline utility).
The syntax would be
devcon disable *hardware ID of your adapter*
You get the HWID (along with many other details) with
wmic NIC
or if you have access to Powershell on your XP-machine you could use that because you can filter ir nicely there. wmic NIC
does nothing else than output the results of Select * From Win32_NetworkAdapter
gwmi win32_networkAdapter | select Name, PNPDeviceID | where {$_.Name -eq "*your adapter name*"}
or
gwmi -query "select Name, PNPDeviceID from Win32_Networkadapter" | where {$_.Name -eq "*your adapter name*"}
The problem with using WMI to disable or enable your adapters is that it is up to the device driver to implement the Disable()
and Enable()
Methods so you cant really rely on it working.
I dont know how well netsh
works for bluetooth adapters and other devices but I would definitely recommend you try that because it's much simpler of a solution than using devcon and having to look up the HWID.