Nav links

Sunday, 11 November 2007

Set Windows XP style on logon

A while ago I displayed a little script that automatically changed the Windows display appearance from 'Windows Classic style' to 'Windows XP style'. It sometimes had problems switching to the correct window to accept key strokes, so I've made some slight adjustments.




//===================================================================
// FILE: XpStyle.js

// DESCRIPTION: automatically set to use Windows XP style

//===================================================================



// create shell object

objShell = new ActiveXObject("WScript.Shell");



// wait for other startup programs to load

WScript.Sleep(1200);



// start appearance applet and activate this window

objShell.Run('rundll32.exe Shell32.dll,Control_RunDLL desk.cpl desk,@Appearance');



// wait for appearance window

WScript.Sleep(200);



//switch to correct window

success = false;



do {

success = objShell.AppActivate("Display Properties");


} while (success == false)



WScript.Sleep(100);



// send the keystrokes to set the style

objShell.Sendkeys("{Down}");

objShell.Sendkeys("{TAB}");

objShell.Sendkeys("{Down}");

objShell.Sendkeys("{ENTER}");