After downloading and installing Updater Application Block yesterday, I need to execute a file. I am not knowledgeable, and this small problem has actually cost me a lot of my scheming.
Now share the conclusions.
First of all, my vbs file association has been captured by "Heroes". I will open Heroes with double click, which is quite depressed. But I used the opening method, tried the browser and cmd, but it was useless.
Today, after I thought of this question, I had the idea to go to Microsoft's News Group to ask. Then I went to the full text search of CSDN. As expected, my keyword is just vbs, and I found a lot of things I want. Learned that this file is used to execute.
I knocked in cmd, but the return error is There no script engine for file extension '.vbs'. At this time I thought of google. Sure enough, I found a lot of useful information, and I found a solution in the first one. The reason is that my vbs association has been lost and the specification must be displayed.
Tap in cmd //e:vbscript . Sure enough, it was successful! ! !
Summary: Use script files like vbs to execute. If the file association is missing. Can be used //e:vbscript.
Attached is a very helpful article I found.
1. What is WSH?
WSH is abbreviated form of Windows Scripting Host (Windows script host). The concept of WSH first appeared in the Windows 98 operating system. It is a script running environment based on a 32-bit Windows platform and independent of the language. For example: you have written a script file yourself, such as a file with the suffix .vbs or .js, and then double-click it under Windows and execute it. At this time, the system will automatically call an appropriate program to interpret and execute it. This program is Windows Scripting Host, and the program execution file name is (if it is at the DOS command prompt, it is).
Want to know if there is WSH on your machine? Just check if there are two files "" or "" in your machine. If you find it, I'm happy! You have WSH installed. Otherwise, install it manually:
In the Windows 98 environment, WSH is automatically installed as a component of the operating system. If you accidentally lose this component, you can open "Control Panel-->Add/Remove Programs-->Windows Installer-->Attachments", and then click "√" before "Windows Scripting Host" and then confirm to complete the installation of the WSH component.
2. The relationship between scripting language and WSH
Everyone knows that scripting languages (including JavaScript and VBscript languages, etc.) are often implanted into web pages (including HTML page client side and ASP page server side). For scripts implanted with HTML pages, the required parsing engine will be loaded by web browsers such as IE; for scripts implanted with ASP pages, the required parsing engine will be provided by IIS (Internet Information Services). For scripts that appear outside of HTML and ASP pages (which often exist in separate files), they need to be processed through WSH. It should be noted that if WSH wants to work normally, it also needs to install IE 3.0 or higher version of IE, because WSH will call the VBScript and JavaScript parsing engines in IE when working. [Unfinished][iduba_page] In these scripting languages that are ported to web pages, most of them are not related to network security. But there are also a few good people with ulterior motives who mix some code that seriously endangers network security (we often call it "malicious code", and they usually express the purpose of "malicious" through modification and registration!) in normal scripts, which often makes us unpredictable. However, if we know a little about scripting language, these "tricks" are very easy to see. Let's start with a few simple examples...
3. Examples of WSH applications
WSH can handle script programs. How to read and write WSH's script source files? As long as you have a little basic (who knows how to program VB better, haha) language, it is not difficult to learn to understand the programs of the WSH scripts language. Go to the C:WINDOWSSAMPLESWSH directory and take a look! There are several classic script examples, and there are two versions of VBScript and JavaScript. As long as we open them in Notepad and study them carefully, it will not be difficult to learn some basic WSH applications.
You just need to enter the code in each instance below in Notepad and save it as the corresponding "*.vbs" file. Double-click this file and you can see the corresponding effect.
Q: How do I open script files? Trying the above solution makes Windows XP throw an error?
A: This is similar to the *.js association problem. Some machines seem to, for some reason, lose their *.vbs association. It's not that the files open with dreamweaver or whatever -- it's that the machine just doesn't know how to run them. If you have a scheduled task, "Could not run" will appear in the status column.
So, you're a smart person and read through the FAQ. You find the *.js extension problem, and you try that fix: you run it as "wscript c:\path\to\". But that, in turn, produces a pop-up error, this time a "Windows Scripting Host" error: "There is no script engine for file extension '.vbs'." So, for some reason, wscript doesn't even know what to do with *.vbs files.
The solution to this problem is to run the script as:
wscript //e:vbscript c:\path\to\
The "//e:vbscript" tells wscript to use the vbscript engine to parse the script. It will then run correctly.
A few alternative solutions, perhaps easier are:
Rename it .vbe (VBScript Encoded Script File). Not sure if this is a bad idea, but it seemed to work for some scripts.
Make a new association for VBS. Open up my computer, select Tools menu-> Folder Options, and go to the File Types tab. There probably isn't a VBS association listed if you have this problem. Select New, type in VBS, and hit Advanced>>. Then, from the pull-down menu, select "VBScript Script File". Making this selection automatically takes care of the association, along with the //e:vbscript problem. This is probably the "correct" solution...
This problems usually occurs only on Windows XP machines, but the cause is not known. A Microsoft KB article on this issue can be found here. Thanks goes to Bob_2k for writing this FAQ entry.
Now share the conclusions.
First of all, my vbs file association has been captured by "Heroes". I will open Heroes with double click, which is quite depressed. But I used the opening method, tried the browser and cmd, but it was useless.
Today, after I thought of this question, I had the idea to go to Microsoft's News Group to ask. Then I went to the full text search of CSDN. As expected, my keyword is just vbs, and I found a lot of things I want. Learned that this file is used to execute.
I knocked in cmd, but the return error is There no script engine for file extension '.vbs'. At this time I thought of google. Sure enough, I found a lot of useful information, and I found a solution in the first one. The reason is that my vbs association has been lost and the specification must be displayed.
Tap in cmd //e:vbscript . Sure enough, it was successful! ! !
Summary: Use script files like vbs to execute. If the file association is missing. Can be used //e:vbscript.
Attached is a very helpful article I found.
1. What is WSH?
WSH is abbreviated form of Windows Scripting Host (Windows script host). The concept of WSH first appeared in the Windows 98 operating system. It is a script running environment based on a 32-bit Windows platform and independent of the language. For example: you have written a script file yourself, such as a file with the suffix .vbs or .js, and then double-click it under Windows and execute it. At this time, the system will automatically call an appropriate program to interpret and execute it. This program is Windows Scripting Host, and the program execution file name is (if it is at the DOS command prompt, it is).
Want to know if there is WSH on your machine? Just check if there are two files "" or "" in your machine. If you find it, I'm happy! You have WSH installed. Otherwise, install it manually:
In the Windows 98 environment, WSH is automatically installed as a component of the operating system. If you accidentally lose this component, you can open "Control Panel-->Add/Remove Programs-->Windows Installer-->Attachments", and then click "√" before "Windows Scripting Host" and then confirm to complete the installation of the WSH component.
2. The relationship between scripting language and WSH
Everyone knows that scripting languages (including JavaScript and VBscript languages, etc.) are often implanted into web pages (including HTML page client side and ASP page server side). For scripts implanted with HTML pages, the required parsing engine will be loaded by web browsers such as IE; for scripts implanted with ASP pages, the required parsing engine will be provided by IIS (Internet Information Services). For scripts that appear outside of HTML and ASP pages (which often exist in separate files), they need to be processed through WSH. It should be noted that if WSH wants to work normally, it also needs to install IE 3.0 or higher version of IE, because WSH will call the VBScript and JavaScript parsing engines in IE when working. [Unfinished][iduba_page] In these scripting languages that are ported to web pages, most of them are not related to network security. But there are also a few good people with ulterior motives who mix some code that seriously endangers network security (we often call it "malicious code", and they usually express the purpose of "malicious" through modification and registration!) in normal scripts, which often makes us unpredictable. However, if we know a little about scripting language, these "tricks" are very easy to see. Let's start with a few simple examples...
3. Examples of WSH applications
WSH can handle script programs. How to read and write WSH's script source files? As long as you have a little basic (who knows how to program VB better, haha) language, it is not difficult to learn to understand the programs of the WSH scripts language. Go to the C:WINDOWSSAMPLESWSH directory and take a look! There are several classic script examples, and there are two versions of VBScript and JavaScript. As long as we open them in Notepad and study them carefully, it will not be difficult to learn some basic WSH applications.
You just need to enter the code in each instance below in Notepad and save it as the corresponding "*.vbs" file. Double-click this file and you can see the corresponding effect.
Q: How do I open script files? Trying the above solution makes Windows XP throw an error?
A: This is similar to the *.js association problem. Some machines seem to, for some reason, lose their *.vbs association. It's not that the files open with dreamweaver or whatever -- it's that the machine just doesn't know how to run them. If you have a scheduled task, "Could not run" will appear in the status column.
So, you're a smart person and read through the FAQ. You find the *.js extension problem, and you try that fix: you run it as "wscript c:\path\to\". But that, in turn, produces a pop-up error, this time a "Windows Scripting Host" error: "There is no script engine for file extension '.vbs'." So, for some reason, wscript doesn't even know what to do with *.vbs files.
The solution to this problem is to run the script as:
wscript //e:vbscript c:\path\to\
The "//e:vbscript" tells wscript to use the vbscript engine to parse the script. It will then run correctly.
A few alternative solutions, perhaps easier are:
Rename it .vbe (VBScript Encoded Script File). Not sure if this is a bad idea, but it seemed to work for some scripts.
Make a new association for VBS. Open up my computer, select Tools menu-> Folder Options, and go to the File Types tab. There probably isn't a VBS association listed if you have this problem. Select New, type in VBS, and hit Advanced>>. Then, from the pull-down menu, select "VBScript Script File". Making this selection automatically takes care of the association, along with the //e:vbscript problem. This is probably the "correct" solution...
This problems usually occurs only on Windows XP machines, but the cause is not known. A Microsoft KB article on this issue can be found here. Thanks goes to Bob_2k for writing this FAQ entry.