Hi,
I have a script which is below but I want to inverse the like statement. For some reason it will not let me use NOT LIKE. Any Ideas?
Thanks
Dave
WMIQuery = "Select * from Win32_Printer where Local=FALSE and ServerName Like '%xxxprint%'"
WMI Querying
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- slinky2000_us
- Posts: 2
- Last visit: Mon May 21, 2007 1:02 am
WMI Querying
Hi,
I have a script which is below but I want to inverse the like statement. For some reason it will not let me use NOT LIKE. Any Ideas?
Thanks
Dave
WMIQuery = "Select * from Win32_Printer where Local=FALSE and ServerName Like '%xxxprint%'"
I have a script which is below but I want to inverse the like statement. For some reason it will not let me use NOT LIKE. Any Ideas?
Thanks
Dave
WMIQuery = "Select * from Win32_Printer where Local=FALSE and ServerName Like '%xxxprint%'"
WMI Querying
WMI doesn't offer that functionality, although it sure would be handy. One workaround would be to return everything where local=false. Then as you enumerate the returned collection, only use the object if an InStr function, is true for what you are looking for. Or you might use regular expression matching.