home *** CD-ROM | disk | FTP | other *** search
- // Windows Script Host Sample Script
- //
- // ------------------------------------------------------------------------
- // Copyright (C) 1996-1997 Microsoft Corporation
- //
- // You have a royalty-free right to use, modify, reproduce and distribute
- // the Sample Application Files (and/or any modified version) in any way
- // you find useful, provided that you agree that Microsoft has no warranty,
- // obligations or liability for any Sample Application Files.
- // ------------------------------------------------------------------------
- //
- // This sample demonstrates how to write/delete entries in the registry.
-
- var vbOKCancel = 1;
- var vbInformation = 64;
- var vbCancel = 2;
-
- var L_Welcome_MsgBox_Message_Text = "┤╦╜┼▒╛╧╘╩╛╚τ║╬┤┤╜¿║═╔╛│²╫ó▓ß▒φ╧εíú";
- var L_Welcome_MsgBox_Title_Text = "Windows Scripting Host ╖╢└²";
- Welcome();
-
-
- // ********************************************************************************
- // *
- // * Registry related methods.
- // *
-
- var WSHShell = WScript.CreateObject("WScript.Shell");
-
- WSHShell.Popup("┤┤╜¿╧ε HKCU\\MyRegKey ╩²╓╡╬¬ 'Top level key'");
- WSHShell.RegWrite("HKCU\\MyRegKey\\", "Top level key");
-
- WSHShell.Popup("┤┤╜¿╧ε HKCU\\MyRegKey\\Entry ╩²╓╡╬¬ 'Second level key'");
- WSHShell.RegWrite("HKCU\\MyRegKey\\Entry\\", "Second level key");
-
- WSHShell.Popup("╜½╩²╓╡╧ε HKCU\\MyRegKey\\Value ╔Φ╬¬ REG_SZ 1");
- WSHShell.RegWrite("HKCU\\MyRegKey\\Value", 1);
-
- WSHShell.Popup("╜½╩²╓╡╧ε HKCU\\MyRegKey\\Entry ╔Φ╬¬ REG_DWORD 2");
- WSHShell.RegWrite("HKCU\\MyRegKey\\Entry", 2, "REG_DWORD");
-
- WSHShell.Popup("╜½╩²╓╡╧ε HKCU\\MyRegKey\\Entry\\Value1 ╔Φ╬¬ REG_BINARY 3");
- WSHShell.RegWrite("HKCU\\MyRegKey\\Entry\\Value1", 3, "REG_BINARY");
-
- WSHShell.Popup("╔╛│² HKCU\\MyRegKey\\Entry\\Value1 ╩²╓╡");
- WSHShell.RegDelete("HKCU\\MyRegKey\\Entry\\Value1");
-
- WSHShell.Popup("╔╛│² HKCU\\MyRegKey\\Entry ╧ε");
- WSHShell.RegDelete("HKCU\\MyRegKey\\Entry\\");
-
- WSHShell.Popup("╔╛│² HKCU\\MyRegKey ╧ε");
- WSHShell.RegDelete("HKCU\\MyRegKey\\");
-
- //////////////////////////////////////////////////////////////////////////////////
- //
- // Welcome
- //
- function Welcome() {
- var WSHShell = WScript.CreateObject("WScript.Shell");
- var intDoIt;
-
- intDoIt = WSHShell.Popup(L_Welcome_MsgBox_Message_Text,
- 0,
- L_Welcome_MsgBox_Title_Text,
- vbOKCancel + vbInformation );
- if (intDoIt == vbCancel) {
- WScript.Quit();
- }
- }
-