diff -r 65d4a4dbb3e5 -r 5ba7dd492647 toggle_dualdisp.vbs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toggle_dualdisp.vbs Thu Jan 21 07:18:34 2010 +0900 @@ -0,0 +1,64 @@ +Dim action +action = "asis" + +If WScript.Arguments.Count <> 1 then + WScript.quit +End If + +If WScript.Arguments.item(0) = "on" Then + action = "on" +Else + action = "off" +End If + + +' Dim Locator +' Dim Service +' Dim QfeSet +' Dim Qfe + +' Set Locator = WScript.CreateObject("WbemScripting.SWbemLocator") +' Set Service = Locator.ConnectServer +' Set QfeSet = Service.ExecQuery("Select * From Win32_DesktopMonitor") + +' Dim accum +' accum = 0 + +' If Qfeset.Count = 2 Then +' For Each Qfe In QfeSet +' accum = accum * 10 +' accum = accum + Qfe.Availability +' Next +' If accum = 38 Or accum = 83 Then +' action = "on" +' ElseIf accum = 33 Then +' action = "off" +' End If +' End If + +Dim objWsh +Set objWsh = WScript.CreateObject("WScript.Shell") +objWsh.Run "control.exe desk.cpl ,4" +Do Until objWsh.AppActivate("画面のプロパティ") + WScript.Sleep 100 +Loop + +If action = "on" Then + objWsh.SendKeys "{TAB}" + objWsh.SendKeys "2" + objWsh.SendKeys "{TAB 4}" + objWsh.SendKeys " " + objWsh.SendKeys "{UP 19}" + objWsh.SendKeys "{LEFT 29}" + objWsh.SendKeys "{DOWN 7}" + objWsh.SendKeys "{TAB 9}" + 'objWsh.SendKeys "{ENTER}" +ElseIf action = "off" Then + objWsh.SendKeys "{TAB}" + objWsh.SendKeys "2" + objWsh.SendKeys "{TAB 5}" + objWsh.SendKeys " " + objWsh.SendKeys "{TAB 8}" + 'objWsh.SendKeys "{ENTER}" +End If +