In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "how to use vbs to list all the components that can be called on the machine", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use vbs to list all the components that can be called on the machine.
Core code
Set wshshell = CreateObject ("WScript.Shell") set registry = CreateObject ("regtool.tob") 'get a dictionary object storage key name set dict = CreateObject ("Scripting.Dictionary")' enumerate all keys in HKEY_CLASSES_ROOT set allkeys = registry.RegEnum ("HKCR\") 'exclude all key names in the keys. Where is the first point of for each key in allkeys'(skip the initial point)? Pos = Instr (2, key, ".") If pos > 0 then 'there's a dot. Is there another one? Pos2 = Instr (pos+1, key, ".") If pos2 > 0 then 'yes, so this name is version specific' check whether we already have a 'version-independent progid! Independent = left (key, pos2-1) if not dict.Exists (independent) then'no, store it dict.Add key, 0 end if else 'this one is version-independent. 'do we already have a version-dependent' progID in store? Vdpid = "" for each element in dict if len (element) > len (key) then if left (element, len (key) + 1) = key & ". Then 'yes, return name vdpid = element exit for end if end if next' any version dependent progID found? If vdpid= "" then'no, add to store dict.add key, 0 else 'yes, replace dict.Remove vdpid dict.add key, 0 end if end if end if next MsgBox dict.Count & "Objects found!" For each key in dict list = list & key & vbCrlf next MsgBox list outputfile = "C:\ OBJECT.TXT" set fs = CreateObject ("Scripting.FileSystemObject") set output = fs.CreateTextFile (outputfile, true) print dict.Count & "Objects found!" Print list output.close wshshell.run outputfile sub Print (text) 'write information to the record file output.WriteLine text end sub here, I believe you have a better understanding of "how to use vbs to list all the components that can be called on the machine", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.