I am looking for some help to accomplish the following:
Get all the com ports on local computer (including the hidden one)
Remove a comport (or all of them if user wishes)
I have been looking and reading on wmi scripting, but, i can't figure out how to pull all hidden ports and how to remove.
any idea or if you can point me in the right direction.... thank you in advance.
this code is not getting me the hidden devices though.. i don't know what i am missing or if i need different script
also, deleting.
Ali Koumaiha
TeknoSoft Inc.
Michigan
Get all the com ports on local computer (including the hidden one)
Remove a comport (or all of them if user wishes)
I have been looking and reading on wmi scripting, but, i can't figure out how to pull all hidden ports and how to remove.
any idea or if you can point me in the right direction.... thank you in advance.
this code is not getting me the hidden devices though.. i don't know what i am missing or if i need different script
also, deleting.
Code:
create cursor ComList (DeviceID c(10), DevName c(100), DevDesc c(100))
strComputer = "."
objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
colItems = objWMIService.ExecQuery("Select * from Win32_SerialPort")
For Each objItem in colItems
*wait window "Description: " + objItem.Description + objItem.DeviceID + 'Name: ' + objItem.Name
sele comlist
append blank
REPLACE DeviceID WITH objItem.DeviceID,;
DevName WITH objItem.Name,;
DevDesc WITH objItem.Description
Next
SELECT ComList
BROWSE
Ali Koumaiha
TeknoSoft Inc.
Michigan