Windows 98 shell Language

Source: Internet
Author: User

 

Windows 98ShellLanguage

Yang shanhe

 

The Senior cfan from Dos crawlers knows that the batch processing language "batch" edits a batch processing file and can be executed in DOS immediately to complete tasks that do not require too much interaction. Such a language is called the shell language. I don't know whether Windows 98 contains the shell language, that is, the script language.

Windows 98 supports two scripting languages: VBScript and JavaScript. If you have edited a text file with the extension of vbs or JS, you will see an icon in the folder that indicates that the file has already been registered. If the default icon is not provided, it indicates that at least one program is associated with it. Who is this application? If you query the registry, you will learn that "C:/Windows/wscript.exe" is related to it. This program is a script language interpreter, which enables you to double-click the script immediately (like executing DOS batch processing.

The script language basically complies with the VB and vj rules. The script that must be explained in IE or other browsers or vB can be executed directly now. Using the scripting language, we can complete some functions that do not require too much user interaction. For example, to add or delete some projects in the registry, you can refer to the following script:

Message_text = "this script shows how to read and write the registry key. "

Title_text = "how to read and write the registry using scripts"

Call welcome ()

Dim wshshell

Set wshshell = wscript. Createobject ("wscript. Shell ")

Wshshell. Popup "the value of hkcu/myregkey is 'top level key '"

Wshshell. regwrite "hkcu/myregkey/", "top level key"

Wshshell. Popup "set the value item hkcu/myregkey/entry/value1 to REG_BINARY 3"

Wshshell. regwrite "hkcu/myregkey/entry/value1", 3, "REG_BINARY"

Sub welcome ()

Dim intdoit

Intdoit = msgbox (msgbox_message_text,

Vbokcancel + vbinformation, title_text)

If intdoit = vbcancel then

Wscript. Quit

End if

End sub

As you can see, the scripting language basically has no restrictions on the data types that must be declared in advance, similar to the early basic we use in DOS. This code first displays a message box to the user. After receiving confirmation from the user (otherwise, the script execution is directly exited and returned to the system), a progid (programming ID) is created as "wscript. shell "object, and then use the popup method of the object to display the prompt information, use the regwrite method to add a key to the Registry, these people who know VB will not be confused. Compared to a string of other languages, is the shell language of Windows 98 much simpler? Will you think of a similar application in the future?

If you do not fully understand the shell language of Windows 98, you can browse the/Windows/samples/wsh folder. Here are some examples provided by Microsoft. Try double-clicking them one by one, and you will be surprised by what happened! Do not believe it. Open the machine now and try it.

 

--

Written in 1998. At that time, 98 was just released. It was quite fresh.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.