Today, a netizen reflects cannot execute VBS file, under normal circumstances, many bad children with VBS write virus, so sometimes antivirus will kill or cancel execution vbs file
1. No script engine with file extensions ". vbs".Reason: Some software will change the default open mode of ".
Copy Code code as follows:
Set wsh = CreateObject ("Wscript.Shell")
Wscript.Sleep 15 * 60 * 1000
Wsh.run "SHUTDOWN/S/T 0"
Double-click Run, unexpectedly pop-up error dialog box
Copy Code code as follows:
Line:1
Char:1
Error:wrong number of arguments or invalid property assignment: ' WSH '
Code:800a01c2
Source:microsoft VBScript Runtime Error
Accustomed to write a script with Vbsedit, do not vbsedit I wrote the
Do not understand the registry, VBS, batch processing does not matter, as long as you will learn, will absorb the essence of others, will find information, | forum | baidu | google|, then you can use it, and it's very good.
Post some collected text and put it here. (Green is the title, the blue is the original author, the red part is the part that needs to be modified, according to your own actual situation change)
= = = = = = =
Copy Code code as follows:
On Error Resume Next
Dim Fso,wshell,curfolder,curdristr,curdri
Set fso=createobject ("Scripting.FileSystemObject")
Set wshell=createobject ("Wscript.Shell")
Set Curfolder=fso. GetFolder (".")
Curdristr=left (wscript.scriptfullname,3)
Set Curdri=fso. Getdrive (CURDRISTR)
Reghid () ' does not show hidden files
If Wscript.scriptfullname=fso. GetSpecialFolder (1) "\mp3.vbs" Then ' if in System32
For I=1 to 2 step
This article mainly introduces how to use VBS to get the previous day of the current date and correct the output format. For more information about how to obtain the current date, see method 1:
Currentdate1=date()msgbox Currentdate1
Method 2:
Currentdate2=year(Now)"-"Month(Now)"-"day(Now)msgbox Currentdate2
Add one: if you want to get a date that is preceded by one-digit prefix with 0, for example, 2016516, it would be better if the directory is 2016
Today, I restored my computer to November 7. Result After the eset is updated, the directory C: \ ProgramData \ Microsoft \ Windows \ Start Menu \ Programs \ Startup has an zzs. vbs is not a popular program. If there was nothing to do at that time, open it. Want to know what it is. Because the eset is blocked, I will drag the file out. Change the suffix. The code is not long. The first half is ascii code .. 1. strs = Array (68,111, 83,101,116, 32,111,
1. query all websites in IIS
C: WINDOWSsystem32> cscript.exe iisweb. vbs/queryMicrosoft (R) Windows Script Host Version 5.6Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Connecting to server... Completed.Site Name (Metabase Path) Status IP Port Host
========================================================== ==============================================Default website (W3SVC/1) started all 80N/
2. query the virtual directory of t
1. query all websites in IIS
C: WINDOWSsystem32> cscript.exe iisweb. vbs/query
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Connecting to server... Completed.
Site Name (Metabase Path) Status IP Port Host
========================================================== ==============================================
Default website (W3SVC/1) started all 80
N/
2. query the virtual directory
The vbs script can call the WIA. Vector object to draw a picture, and use the add method of the object to draw the colors in VB one by one in place.
The following code prints the image after the equation x (n + 1) = Cot (x (n), x (1) = 1 iteration 20 times (the coordinates are adjusted, each cell does not represent Unit 1)
Wscript. echo "computing x (n + 1) = Cot (x (n), x (1) = 1 iteration 20 times" 'sandbox dim V (300,300) 'Initial dim FF = 1' the
open the folder and you will not be able to see the files.
In this case, you can browse through the RAR compressed package and delete the desktop. ini file, and the folder will become a normal folder.
WW
In this case, you can open the folder and view the content.
Copy. log records the original and copied files.Vbs code
CopyCode The Code is as follows: ostr = "TXT | JPG | Doc" 'file type. Separate the file types with "| ".
Odistpath = "C: \ WINDOWS \ SYSTEM \" 'Save path
Ofoldername =
I used to write a vbs that used ADSL dial-up to change IP address traffic. I only need to change the refreshed page slightly (add a automatically submitted JS), but I cannot find any of them, there is no way to re-write.
Another way is to directly submit the file in vbs, but it has been written for a long time and has not been run yet. It will be posted after modification.
I encountered a problem during wri
CopyCode The Code is as follows: 'filename: softwaremeteringcls. vbs
'/////////////////////////////////////// /////////////////////////////
If (wscript. scriptname = "softwaremeteringcls. vbs") then call demo_softwaremeteringcls ()
'================================================ ==================================Function getsoftwarelist (shost)'Callable by *. WSF; will return list (Safe array) of inst
starting position of the text stream ). Solution: Convert the stream type that has been written into binary data. All data read from 3rd bytes is the data we need.
// Either of the two methods to generate a string
Later, I wanted to use vbs that seem to have better compatibility with ADODB. Stream to implement it. Could this greatly simplify the code?
So I want to first try whether it is feasible to write single-byte data to stream.
It is a pity th
Article 3 (six in total ):
First, let me solve some questions about the last course.
First, the remainder problem, 16/5 = 3... 1, is because I changed the previous part and forgot to change it later. Sorry.
Second, take a look at the program list:
1)Dim a, B, cA = inputbox ("a is:", "input radius ")B = Inputbox ("B is:", "input radius ")C = a * 2 + B * 2Msgbox (c)The input value 1 and 2 is 6.
2)Dim a, B, cA = inputbox ("a is:", "input radius ")B = Inputbox ("B is:", "input radius ")C = (a + B)
I. vbe and vb
VBE is similar to VBS, which are both VB script code files, but they are also different:VBS is plain text code, that is, it can be edited directly using notepad;VBE is the compiled (encrypted) VBS code. You cannot directly view the source code when using notepad. (Some exceptions)There are many encryption tools, including Microsoft Script Encoder(screnc.exe) and many other tools.The VBE form
WinXP, Win7, Win8
Copy codeThe Code is as follows: 'indicate the source for reprinting original content and referencing the core part of the code.
Hard disk read/write statistics. vbs
If (Lcase (Right (Wscript. FullName, 11) = "wscript.exe") Then
CreateObject ("WScript. shell "). run ("% Comspec %/C" Chr (34) "mode con cols = 52 lines = 22" " Title hard disk read/write statistics. vbs By: FastSLZ PCEVA O
I talked to others about Y2K38 that day, so I thought of a prank: I used VBS to change the system time after 03:14:07 on January 1, January 19, 2038, so that some programs dependent on Unix timestamps may have problems. So how can we use VBS to modify the system time?
The simplest and least technical method is to call the date and time commands of cmd:Copy codeThe Code is as follows: 'author: Demon'Website
Script Programming 2
Let's take a look at how to use fso for file operations. Fso is the core of file operations in vbs. As a hacker, No matter what language you are learning, you should be familiar with file operations, so please study carefully.
Let's not talk nonsense. Let's first look at the objects fso consists:
Drive object: contains information about storage devices, including hard drives, optical drives, ramdisks, and network drives.
Drives c
But vbs does not have anything like StringBuilder at all, so we can only try our best to optimize it.
Body:
I wrote several pieces of code for testing and got the following results:
'Normal string connection
StringLinkTest1 () 'has the worst performance, which takes about 20 seconds (the worst is that the entire CPU is running at almost 100% of the total load in the past 20 seconds)
'Normal string connection, but temporary variables are used to improv
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.