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
step is to get the user input and write it to the specified INI and XML. I personally think that there are few ways for AI to play freely. Its custom actions (Custom Actions) can call EXE, JS, vbs, and other things, but JS and vbs have nothing to do with them, A little timid. To solve the problem in a familiar way, you can use C # To write an EXE, PASS Parameters through the main function, and write parame
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
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
Start menu
' Turn off system ' feature in the Start menu is disabled by call Change (Startmenu_close)
Save the above code as a Changestartmenu.vbs file, and double-click it when you use it.
VII. implementation of external procedures
Edit the following in Notepad:
DIM Objshell
Set Objshell=wscript.createobject ("Wscript.Shell")
Ireturn=objshell.run ("cmd.exe/c set Var=world", 1, TRUE)
Save as a. vbs file. In this code, we first set up an environm
Adsutil. vbs basic usage
With this knowledge, let's go back to adsutil. vbs to see its usage:
C:/inetpub/adminscripts> cscript adsutil. vbsMicrosoft (r) Windows Script Host version 5.6Copyright (c) Microsoft Corporation 1996-2001. All rights reserved.Usage:Adsutil. vbs Description:IIS administration utility that enables the configuration of metabase PropertiesSup
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
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
this code, we first set up an environment variable named Var, and the value is world, the user can use%comspec% instead of Cmd.exe, and the command: Set Var=world can be changed to another command, so that it can run arbitrary commands.
Viii. Restart the specified IIS service
Edit the following in Notepad:
Const ads_service_stopped = 1
Set objcomputer = GetObject ("Winnt://mycomputer,computer")
Set objservice = Objcomputer.getobject ("Service", "M
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.'*********************************
. In this code, we first set up an environment variable named Var, and the value is world, the user can use%comspec% instead of Cmd.exe, and the command: Set Var=world can be changed to another command, so that it can run arbitrary commands.
Viii. Restart the specified IIS service
Edit the following in Notepad:
Const ads_service_stopped = 1
Set objcomputer = GetObject ("Winnt://mycomputer,computer")
Set objservice = Objcomputer.getobject ("Service"
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.