Windows 98's shell language

zhaozj2021-02-16  50

Windows 98's shell language

Yangshan River

Senior CFAN from DOS Touching CFAN knows that batch language is edited a batch file, immediately executing under DOS, complete some tasks that do not need much interaction. Such a language is called the shell language. I don't know everyone noted that there is no shell language under Windows in the Windows98 system, which is the scripting language.

There are two scripting languages ​​supported by Windows98 systems: VBScript and JavaScript. If you edit a text file called VBS or JS, you will see an icon to which the system gives the file in the folder indicates that this file has already registered. Not given the default icon description, at least one program is associated, who is this app? If you query the registry, you will learn about "c: /windows/wscript.exe". This procedure is a scripting language interpreter, which is exactly what you can double-click on the script (like performing DOS batch).

The scripting language is basically complied with the VB and VJ rules. The scripts that must be interpreted in browser or VBs such as IE can now be executed directly. Using scripting languages ​​we can complete some features that do not need too many users, such as you want to add or remove certain items 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 Use the script read and write registry"

Call Welcome () DIM WSHSHELL SET WSHSHSHSHSHELL = WScript.createObject ("wscript.shell")

Wshshell.popup "Create item HKCU / MyREGKEY value is 'top level key'"

Wshshell.Regwrite "HKCU / MyRegkey /", "Top Level Key"

WSHShell.popup "Sets the value of the 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

It can be seen that the scripting language is basically no restrictions on the data type, similar to our early Basic used under DOS. This code first displays a message box to the user, after obtaining the user's confirmation (otherwise exiting the script directly, returning to the system), create an object of "wscript.shell", then use the object The POPUP method displays the prompt information, using the regWrite method to add a key to the registry, some people who know VB will not feel puzzled. Compared to other languages, a large string of the windows98 is much simpler? If you have a similar application in the future, will you think of it?

If you feel that you can't fully understand the WINDOWS98 Shell language, you can browse the / windows / samples / wsh folder, which is several examples of Microsoft to you. Try a double-click, you will be surprised by everything happening! Do not believe, please turn on the machine now. -

1998 Written, then 98 just came out, very fresh

转载请注明原文地址:https://www.9cbs.com/read-20882.html

New Post(0)