24-1 ������������

ڭ̥iHϥ WSH ӹqୱi²檺޲zC

ҦpAYnbୱإ߰Oƥ|AiHϥΤUC{XG

lɡ]shortcutCreate01.js^G]ǦϰUYi^
// bୱإ߰Oƥ|

//  WSH Shell
wshShell = WScript.CreateObject("WScript.Shell");
// ϥSpecialFoldersŪୱ|
desktopPath = wshShell.SpecialFolders("Desktop");
// ୱWإ߱|(shortcut object)
shortcut01 = wshShell.CreateShortcut(desktopPath + "\\WSH ͪOƥ|.lnk");
// ]w|(shortcut object)propertiesxs
shortcut01.TargetPath = "c:\\windows\\notepad.exe";
shortcut01.Save();

Wz{AA|bAqୱo{@ӷs|AW٬uWSH ͪOƥ|vC

pGQnN@q WSH ͪreŶKïAڭ̥iH}Ҥ@sAQs window 󪺤k setData ӱNreܰŶKïAMAsCШUCdҡG

lɡ]clipboard01.js^G]ǦϰUYi^
// NSwreܰŶKï
// Reference: http://www.microsoft.com/technet/scriptcenter/resources/qanda/aug04/hey0813.mspx

strCopy = "oOQeܰŶKïr"
objIE = WScript.CreateObject("InternetExplorer.Application");
objIE.visible = false;
objIE.Navigate("about:blank");
objIE.document.parentWindow.clipboardData.setData("text", strCopy);
objIE.Quit();

WzdҫAAiH}ҰOƥAM Ctrl-vANiHNŶKïrKOƥFC

pGAୱӦhAQni걵]Cascade^AiHϥΤUC{XG

lɡ]winCascade.js^G]ǦϰUYi^
// |ܿùW
objShell = new ActiveXObject("Shell.Application");
objShell.CascadeWindows();

YnñơAiΤUC{XG

lɡ]winTileH.js^G]ǦϰUYi^
// ñƿùW
objShell = new ActiveXObject("Shell.Application");
objShell.TileHorizontally();

YnñơAiΤUC{XG

lɡ]winTileV.js^G]ǦϰUYi^
// ñƿùW
objShell = new ActiveXObject("Shell.Application");
objShell.TileVertically();

ոճoǵ{XAAN|oı WSH KQʡI


JScript {]pPΡGΩ WSH