Hi,
Have you tried running the VBS scipt on different machines with Version 2004 & Version 20H2? Did all of them get the same error?
If so, please first try below troubleshooting steps to see if any help.
- Start > Settings > Apps > Default apps > Choose default apps by file type > manually select "Microsoft Windows Based Script Host" again for .vbs extension > run script again to check if error
- Stop and restart winmgmts servuces
Open command prompt > run net stop winmgmt > open Windows Explorer, navigate to %systemroot%\system32\wbem and delete the Repository directory > run net start winmgmt > run script again to check if error - Re-register the dll file
Open command prompt > run below commands:
cd /d %windir%\system32\wbem
for %i in (.dll) do RegSvr32 -s %i
for %i in (.exe) do %i /RegServer
If all above methods cannot resolve the error, please check if you can use the VBS script in below link to remove all network printers. I have done a lab test in my environment. My version is windows 2004 OS build 19041.572. I can run the script successfully.
How to remove all network printers on a computer
https://gallery.technet.microsoft.com/scriptcenter/How-to-remove-all-network-d3979e18
Thanks,
Eleven
If the Answer is helpful, please click "Accept Answer" and upvote it. Thanks.