Http://blog.csdn.net/jinghaianlangethis blog has a considerable number of vbs and WMI learning guides. Very good.
In msdn this URL has a lot of WMI learning materials: http://msdn.microsoft.com/zh-cn/library/ms974579.aspx
Reprinted from: http://blog.csdn.net/jinghaianlange/archive/2007/07/16/1693645.aspx
In Windows, it may be easy to learn computer operations, but many computers work repeatedly. For example, you may need to copy, paste, re
What's the use of using a VBS (VBScript script) to enumerate the Windows operating system's processes today? For example, it's useful to have a process that you sometimes want to monitor for whether it's running.
Example:
Enumerating processes with the VBS script
' Enum.vbs
Dim wmi,objs,process
set Wmi=getobject (' winmgmts: ')
set OBJS=WMI. InstancesOf ("Win32_Process")
process= "for each
Obj in
First make sure that the visual Stuido is installed on the machine,then open a command-line window to execute the following command, which pops up the confirmation window for debugging using Visual Studio. Point "yes" for debugging.
WScript.exe [VBS file full PATH] [parameter 1] [parameter 2] [...] [Parameter n]//d//x
WScript.exe Command Description:
WScript.exe C:\Test.vbs par1 par2 par3//d//x
Parameter description:
D Open the d
Mobile phone typing is really troublesome, so I will not directly provide instances for some simple or too complex code.
1. Not a method-add commentsAdd unnecessary comments without signature. Code omitted
2. case-insensitive Mixing
Ignore case sensitivity using VBS
3. Mixing branches and peers
Use the colon (:) to connect multiple lines of code as one line
4. One row is divided into multiple rows
Use the hyphen (_) to write a row into multiple ro
Mobile phone typing is really troublesome, so some simpler or too complex code I do not directly provide an example.
1, not the method of the method--Add notes
Add some rules useless annotations without signatures. Code slightly
2. Mixed case and writing
Use VBS to ignore case
3, the branch and the colleague mixes uses
Use a colon (:) to connect multiple lines of code to one line
4, one line divided more than one line
Use a continuation
The following code is slightly modified. The original structure is that the script is executed synchronously with the released bat and the bat is deleted after the bat execution is completed. It is intended that no temporary files are left. Later, I thought about the poor universality. For example, if the bat file released for execution is a monitoring type of resident processes, VBS will wait endlessly and cannot exit, so it should be changed to asyn
Article author: xiaolu [BST]
Source of information: Evil Octal Information Security team (www.eviloctal.com)
This is not exe2vbs all types of files can be converted, but limited to string size files cannot be too big I tested 3m files is OK
Save the following code as: File2vbs.vbs
Copy Code code as follows:
' Program by Xiaolu
' Name:file2vbs.vbs
On Error Resume Next
Do While 1
Fname=inputbox ("Enter file name (including path) to convert:", "Enter filename", "F:\hhh.exe")
If Fn
VBS learning diary (2) Basic knowledge, vbs DiaryVBScript BasicsI. Variables1,All content after single quotes is interpreted as comments. (Ctrl + m comments in vbsedit and ctrl + shift + m comments in reverse comments)2. In VBScript, variable naming rules follow standard naming rules. Note the following:Variables, methods, functions, and objects are case-insensitive in VBScript.. When declaring a variable,
The following code is slightly modified, the original structure is the script and the release of the bat synchronized execution and wait for the bat after the completion of the bat deletion, is not left behind temporary files. Then think about the common bad, such as releasing the execution of the bat file is a resident process of the monitoring type that VBS will be endless waiting and can not quit, so or instead of asynchronous execution, the script
can generate hundreds of M log files in a day, and they must be cleaned up in time.
There are two solutions:1. Clean the logs of the previous 60 days every day2. Clear the logs 60 days ago in a short time.However, either method requires technical processing. If you manually delete it, you can find the log file that was deleted 60 days ago unless you are very professional. However, even if your technology is good, this method is also very time-consuming. The best method is to use DOS batch proce
A Pick fast chickens to do VPN.When the young rookie transformation for the old rookie, you know to consider playing hacking while also try to ensure that not exposedMyself. Everything, Safety first! Otherwise do not know which day play to play is the police uncle brought tea ^_^.Therefore, as the old rookie of us, we should learn to hacking, more use vpn+ terminal and other springboard measures to protect themselves, as far as possible not to expose themselves directly to the place.However, due
Yesterday in the VBS bar to see a essence of the "VBS code format Tool", is written in C + +, a district of the VBS code format, do not Labor C + + to the bar, with the VBS implementation of the
.
Wdopenformatxmltemplatemacroenabled 12 enables the XML template format for macros.
─────────────────────────────────────────────────────────────────
Since word opens TXT with a default font size of 10.5 points, this value is small in the Web page, the appropriate value is 13~15 points, so you need to change the font size, and also need to change the default Western font, where you choose--times New Roman:
Set ORange = Objdoc.range ()
ORange.Font.S
learned VB knows that the msgbox function is one of the most commonly used functions in vbprogramming. It can implement pop-up window prompts.
Figure 1
Figure 2
If there is output, there will be input. What corresponds to msgBox is the input function InputBox, which is used to receive user input information and then return it to the specified variable. The following is an example. Enter the following content in your notebook:
Dim nameName = InputBox ("Enter your internet cafe Name", "Name ")
Copy codeThe Code is as follows: 'COMMAND admin. vbs for running programs as Administrator
Set ob1_miservices = GetObject ("winmgmts: {impersonationLevel = impersonate }! \. \ Root \ cimv2 ")
Set ob1_bemobjectset = ob1_miservices. ExecQuery (_
"SELECT * FROM Win32_Process WHERE "_
"ExecutablePath = '" Replace (WScript. FullName, "\", "\") "' and "_
"CommandLine LIKE '%" WScript. ScriptName "% '")
For each ob1_bemobject in ob1_bemobjectset
Required
The problem of data structure is very important, if you can describe the input and output data structure of a problem, then this question is very promising, the data structure is not the patent of C language, the real data structure is pseudo code. The following stack class is the code I used to collect others, and in fact whenever I consider a program problem, especially a complex one, it should be thought of what kind of data to describe your input and output.'*********************************
communicate with the operating system, and modify the registry is only its communication with the operating system tip of the iceberg. It has so many advantages and practicality, is much favored by many Windows users.
It says WSH use VBS to modify the system registry, but you must first create an object that communicates with the operating system, and then manipulate the registry using various methods of the object, creating the method and
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.