VBScript
From Wikipedia, the free encyclopedia
VBScript (short for Visual Basic Scripting Edition) is an Active Scripting language interpreted via Microsoft's Windows Script Host. The language's syntax reflects its pedigree as a variation of Microsoft's Visual Basic programming language. It initially gained support from Windows administrators seeking an automation tool more powerful than the batch language first developed in the late 1970s.
VBScript is interpreted by one of two script engines, depending on the environment. In a web environment, vbscript.dll is used, which can be invoked by the ASP engine asp.dll. Secondly, vbscript can be invoked using Windows Script Host (WSH) in two ways. Wscript.exe is used to display output and receive input in Windows GUI format such as dialog and input boxes. Cscript.exe is used in a command-line environment. When VBScript source code is contained in stand-alone files, they have the file extension .vbs
.
When employed in Microsoft Internet Explorer, VBScript is very similar in function to JavaScript –- it processes code embedded in HTML. VBScript can also be used to create stand-alone HTML applications (file extension .hta
) which require Internet Explorer 5 or later to run. HTA's do not directly use Internet Explorer, but rather an executable called mshta.exe
interprets and runs the code. This is done to have full capability to the operating system just as a normal script does. If run in Internet Explorer, the script runs with limited rights to the operating system just like the browser. Web developers generally use JavaScript or a server-based scripting language such as PHP instead for better browser compatibility.
[edit] Criticism
VBScript is the language used to write some notable e-mail worms, such as ILOVEYOU. Although the language is not inherently insecure, the Scripting Host has little or no security features. The ILOVEYOU worm hid the .vbs extension by taking advantage of the default Windows behavior that hides known file extensions. The file would really be named iloveyou.txt.vbs, but Windows would show it as iloveyou.txt. The scroll-like icon was the only overt clue to the difference. As VBScript has tight integration into Windows, a basic e-mail worm can be written in VBScript with just a few lines of code.
More productive examples of how VBScript can be used is the SYDI project, or in software packaging, where VBScript can be used to automate slipstreaming, and other aspects of the process.