開啟、關閉雙螢幕

此script只適用於WinXP,Win7請使用快捷鍵(win + P)
開啟:
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,4");
WScript.Sleep(1000);
WshShell.SendKeys("{TAB}");
WshShell.SendKeys("{DOWN}");
WshShell.SendKeys("{TAB 4}");
WshShell.SendKeys("{ }");
//WshShell.SendKeys("%A");
WshShell.SendKeys("~");

關閉:
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,4");
WScript.Sleep(1000);
WshShell.SendKeys("{TAB}");
WshShell.SendKeys("{DOWN}");
WshShell.SendKeys("{TAB 5}");
WshShell.SendKeys(" ");
WshShell.SendKeys("~");