Batch Process API WMIC learning experience 1th/2 page _dos/bat

Source: Internet
Author: User
Tags snmp
An article written in a Black Hand column.
Api--wmic learning experience in batch processing LCX
In this article you may not see a lot of strange and useful practical routines, but, to teach people to fish than to teach people to fishing, I hope my article can let you understand some of the basic knowledge of WMIC, can have a learning interest, let oneself continue to study WMIC.

In Windows\Help, the Wmic.chm document explains WMI in this way: Windows Management Instrumentation (WMI) is the Web-based Enterprise Management Initiative (WBEM) (This is a Microsoft implementation that aims to establish a standard industrial initiative for accessing and sharing management information on the corporate network.) For more information about WBEM, please visit WBEM. XOXWMI provides complete support for the Common Information Model (CIM), which describes the objects that exist in the administrative environment. WMI includes the object repository and the CIM object manager, where the object repository is a database that contains object definitions, and the object manager handles the collection and operation of objects in the repository and collects information from the WMI provider (WMI provider). The WMI provider (WMI provider) acts as an intermediary between WMI and the components of the operating system, applications, and other systems. For example, the registry provider provides information from the registry, while the SNMP provider provides data and events from the SNMP device. The provider provides information about its components, or it may provide methods that manipulate the components, properties that can be set, or an event that may alert you to changes in the component. Windows Management Instrumentation command Line (WMIC) provides you with a simple Windows Management Instrumentation (WMI) command-line interface that allows you to use WMI to manage running Win Dows's computer. WMIC operates with existing command-line programs and utility commands, and it is easy to extend WMIC through scripting or other management-oriented applications.

These statements are too professional, popular point is that Wmic.exe is a command-line program, you can use it to implement the interface directly under the command line to manage computer hardware and software and other aspects of operations, the equivalent of batch processing API.

A brief analysis of the basic command format of WMIC
Often read the relevant information on the Internet, the reader may have a basic understanding of WMIC, but the more you look at the more likely to be confused, at least I think so. In fact, a simple summary, the command format is "wmic+ global switch + alias +WQL sentence + verb + adverb (or the parameters of the verb) + verb switch" just. This command format can be written or written in a partial format as needed, and I'll explain each of the names of the format in turn, but I'm sure it's completely out of line with the definition of Microsoft experts and just let everyone understand them.

WMIC is Wmic.exe, located under the Windows directory, and is a command-line program. WMIC can be performed in two modes: interactive mode (Interactive mode) and non-interactive mode (non-interactive modes), and readers who frequently use the Netsh command line should be familiar with both modes.
Interactive mode. If you enter WMIC at a command prompt or through the Run menu, you will enter WMIC's interactive mode, which will be returned to the WMIC prompt whenever a command completes, such as "root\cli", which is typically used when multiple WMIC directives need to be executed. Interaction patterns sometimes identify sensitive operational requirements, such as delete operations, to minimize user action errors.
Non-interactive mode. Non-interactive mode is to place WMIC instructions directly as WMIC parameters behind WMIC, and then return to the normal command prompt when the instruction is finished, instead of entering into the WMIC context environment. WMIC's non-interactive mode is mainly used in batch processing or some other script files, and I use the Non-interactive mode example in this article.

Switch has the following global switch, into Wmic.exe/? can be seen (here we do not discuss the specific meaning of each switch, the specific use of the example):

The namespace path used by the/namespace alias.
/role contains the role path defined by this alias.
The server used by the/node alias.
/implevel Customer Impersonation level.
/authlevel the customer authentication level.
/locale the language identifier applied by the customer.
/privileges Enable or disable all privileges.
/trace output debug information to stderr.
/record writes all input commands and outputs to the log.
/interactive Sets or resets the interaction mode.
/failfast Sets or resets failfast mode.
The user used during the/user session.
/password the password used for session logons.
/OUTPUT Specifies the mode for the output redirection.
/APPEND Specifies the mode for the output redirection.
/aggregate set or Reset collection mode.
/authority Specifies the <authority type> for the connection.
/? [: <brief| FULL&GT] Usage information.

Current 1/2 page 12 Next read the full text

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.