It depends on what you are trying to disable. If you are trying to disable LAN network interfaces, the only way on XP machines (as far as I know) to do this programmatically is to use devcon.exe (a program that looks like a device manager command line utility).
The syntax will be
devcon disable *hardware ID of your adapter*
You get an HWID (along with many other details) with
wmic NIC
or if you have access to Powershell on your XP machine, you can use this because there you can easily filter. wmic NIC does nothing but output 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 the device driver must use the Disable() and Enable() methods, so you cannot rely on it to work.
I donβt know how well netsh works for bluetooth adapters and other devices, but I definitely recommend that you try this because it is a lot easier solution than using devcon and having to search for HWID.
source share