Modify the icon size with a WSH script

The following script demonstrates how to access the Windows Registry and modifies the settings for small icons (these icons are shown in the left Windows Explorer pane for instance).

//************************************************
// File:   WSHIconSIze.js (WSH sample in JScript)
// Author: (c) G. Born Version 1.0
//
// Das Modul vergrößert die in der Windows-Shell benutzten
// verkleinerten Symbole (z.B. im Explorer).
// !!!Nutzung auf eigenes Risiko!!!
//
// This module magnifys the small icons used in the Windows shell
// (in the left Explorer pane for instance). The dialogs are kept in
// English and in German.
//
// In no way shall the author be liable for any
// losses or damages resulting from the use of this
// program. Use AS-IS at your own risk.
//
// The code is the property of the author. You may
// use the code and modify it, as far as this header
// remains intact. Further updates and other samples
// may be found on my site:
// http://www.borncity.de
//************************************************
var IconSize = "32"     // this is the size : neue Größe
var vbYesNo = 4;
var vbOK = 0
var vbInformation = 64;
var vbCancel = 2;
var vbYes = 6
// Set variable : Variable setzen
var Root = "HKEY_CURRENT_USER";
var key = "\\Control Panel\\Desktop\\WindowMetrics\\";
var valname = "Shell Small Icon Size";
var result;
var WSHShell = WScript.CreateObject("WScript.Shell");
{
 result = WSHShell.Popup(
    "Kleine Shell-Symbole von 16 auf " + IconSize + " Pixel vergrößern?\n\n\r" +
     "Resizes small shell icons from 16 to " + IconSize + " pixels",
    0,
    "Windows 98 - powered by Günter Born",
    vbYesNo + vbInformation );
    if (result == vbYes) 
     {
      WSHShell.RegWrite(Root + key + valname, IconSize, "REG_SZ");
     } 
     else
     {
      WSHShell.RegWrite(Root + key + valname, "16", "REG_SZ");
      WSHShell.RegDelete(Root + key + valname);
     }
      WSHShell.Popup("Bitte Windows neu starten"+
                     "\n\n\rPlease restart Windows",
                      0,
      "http://www.borncity.de",
                      vbOK);
}
//*** End

Details about these Registry keys may be found in my title "Inside the Registry of Microsoft Windows 98" (Microsoft Press).

Back

(c) G. Born