bat and vbs files are moved to ~/lib.
authorShingo W. Kagami
Thu, 21 Jan 2010 22:46:10 +0900
changeset 5091708199d17
parent 4 1b55a5510213
child 6 0387681eee81
bat and vbs files are moved to ~/lib.
lan_dhcp.bat
lan_ic.bat
mamefile.sh
toggle_dualdisp.vbs
toggle_if.vbs
wireless_dhcp.bat
wireless_ic.bat
     1.1 --- a/lan_dhcp.bat	Thu Jan 21 14:04:22 2010 +0900
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,5 +0,0 @@
     1.4 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs wireless disable
     1.5 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs lan enable
     1.6 -netsh interface ip set address "ローカル エリア接続" dhcp
     1.7 -netsh interface ip set dns "ローカル エリア接続" dhcp
     1.8 -netsh interface ip set wins "ローカル エリア接続" dhcp
     2.1 --- a/lan_ic.bat	Thu Jan 21 14:04:22 2010 +0900
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,5 +0,0 @@
     2.4 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs wireless disable
     2.5 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs lan enable
     2.6 -netsh interface ip set address "ローカル エリア接続" static 10.240.10.207 255.255.255.0 10.240.10.1 1
     2.7 -netsh interface ip set dns "ローカル エリア接続" static 130.34.54.2
     2.8 -netsh interface ip add dns "ローカル エリア接続" 130.34.232.25
     3.1 --- a/mamefile.sh	Thu Jan 21 14:04:22 2010 +0900
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,8 +0,0 @@
     3.4 -#!/bin/sh
     3.5 -
     3.6 -if [ "$1" = "" ]; then
     3.7 -    /cygdrive/c/local/Mame5/Mame5.exe
     3.8 -    exit
     3.9 -fi
    3.10 -
    3.11 -/cygdrive/c/local/Mame5/MameFile5.exe `cygpath -wa $1`
     4.1 --- a/toggle_dualdisp.vbs	Thu Jan 21 14:04:22 2010 +0900
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,64 +0,0 @@
     4.4 -Dim action
     4.5 -action = "asis"
     4.6 -
     4.7 -If WScript.Arguments.Count <> 1 then
     4.8 -   WScript.quit
     4.9 -End If
    4.10 -
    4.11 -If WScript.Arguments.item(0) = "on" Then
    4.12 -    action = "on"
    4.13 -Else
    4.14 -    action = "off"
    4.15 -End If
    4.16 -
    4.17 -
    4.18 -' Dim Locator
    4.19 -' Dim Service
    4.20 -' Dim QfeSet
    4.21 -' Dim Qfe
    4.22 -
    4.23 -' Set Locator = WScript.CreateObject("WbemScripting.SWbemLocator")
    4.24 -' Set Service = Locator.ConnectServer
    4.25 -' Set QfeSet = Service.ExecQuery("Select * From Win32_DesktopMonitor")
    4.26 -
    4.27 -' Dim accum
    4.28 -' accum = 0
    4.29 -
    4.30 -' If Qfeset.Count = 2 Then
    4.31 -'     For Each Qfe In QfeSet
    4.32 -'         accum = accum * 10
    4.33 -'         accum = accum + Qfe.Availability        
    4.34 -'     Next
    4.35 -'     If accum = 38 Or accum = 83 Then
    4.36 -'         action = "on"
    4.37 -'     ElseIf accum = 33 Then
    4.38 -'         action = "off"
    4.39 -'     End If
    4.40 -' End If
    4.41 -
    4.42 -Dim objWsh
    4.43 -Set objWsh = WScript.CreateObject("WScript.Shell")
    4.44 -objWsh.Run "control.exe desk.cpl ,4"
    4.45 -Do Until objWsh.AppActivate("画面のプロパティ")
    4.46 -    WScript.Sleep 100
    4.47 -Loop
    4.48 -
    4.49 -If action = "on" Then
    4.50 -    objWsh.SendKeys "{TAB}"
    4.51 -    objWsh.SendKeys "2"
    4.52 -    objWsh.SendKeys "{TAB 4}"
    4.53 -    objWsh.SendKeys " "
    4.54 -    objWsh.SendKeys "{UP 19}"
    4.55 -    objWsh.SendKeys "{LEFT 29}"
    4.56 -    objWsh.SendKeys "{DOWN 7}"
    4.57 -    objWsh.SendKeys "{TAB 9}"
    4.58 -    'objWsh.SendKeys "{ENTER}"
    4.59 -ElseIf action = "off" Then
    4.60 -    objWsh.SendKeys "{TAB}"
    4.61 -    objWsh.SendKeys "2"
    4.62 -    objWsh.SendKeys "{TAB 5}"
    4.63 -    objWsh.SendKeys " "
    4.64 -    objWsh.SendKeys "{TAB 8}"
    4.65 -    'objWsh.SendKeys "{ENTER}"
    4.66 -End If
    4.67 -
     5.1 --- a/toggle_if.vbs	Thu Jan 21 14:04:22 2010 +0900
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,53 +0,0 @@
     5.4 -if WScript.Arguments.Count <> 2 then
     5.5 -        wscript.quit
     5.6 -end if
     5.7 -
     5.8 -Dim sConnectionName
     5.9 -if WScript.Arguments.Item(0) = "lan" then
    5.10 -        sConnectionName = "ローカル エリア接続" 
    5.11 -else
    5.12 -        sConnectionName = "ワイヤレス ネットワーク接続" 
    5.13 -end if
    5.14 -
    5.15 -Dim sVerb
    5.16 -if WScript.Arguments.Item(1) = "enable" then
    5.17 -        sVerb = "有効にする(&A)" 
    5.18 -else
    5.19 -        sVerb = "無効にする(&B)" 
    5.20 -end if
    5.21 -
    5.22 -
    5.23 -Const ssfCONTROLS = 3 
    5.24 -Const sConPaneName = "ネットワーク接続" 
    5.25 -
    5.26 -set shellApp = createobject("shell.application") 
    5.27 -set oControlPanel = shellApp.Namespace(ssfCONTROLS) 
    5.28 -set oNetConnections = nothing 
    5.29 -
    5.30 -for each folderitem in oControlPanel.items 
    5.31 -	if folderitem.name = sConPaneName then 
    5.32 -		set oNetConnections = folderitem.getfolder: exit for 
    5.33 -	end if 
    5.34 -next 
    5.35 -
    5.36 -if oNetConnections is nothing then 
    5.37 -	wscript.quit 
    5.38 -end if 
    5.39 -
    5.40 -set oLanConnection = nothing 
    5.41 -for each folderitem in oNetConnections.items 
    5.42 -	if lcase(folderitem.name) = lcase(sConnectionName) then 
    5.43 -		set oLanConnection = folderitem: exit for 
    5.44 -	end if 
    5.45 -next 
    5.46 -
    5.47 -if oLanConnection is nothing then 
    5.48 -	wscript.quit 
    5.49 -end if 
    5.50 -
    5.51 -for each verb in oLanConnection.verbs 
    5.52 -	if verb.name = sVerb then 
    5.53 -		verb.Doit 
    5.54 -		WScript.Sleep 2000 
    5.55 -	end if 
    5.56 -next 
     6.1 --- a/wireless_dhcp.bat	Thu Jan 21 14:04:22 2010 +0900
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,5 +0,0 @@
     6.4 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs lan disable
     6.5 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs wireless enable
     6.6 -netsh interface ip set address "ワイヤレス ネットワーク接続" dhcp
     6.7 -netsh interface ip set dns "ワイヤレス ネットワーク接続" dhcp
     6.8 -netsh interface ip set wins "ワイヤレス ネットワーク接続" dhcp
     7.1 --- a/wireless_ic.bat	Thu Jan 21 14:04:22 2010 +0900
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,5 +0,0 @@
     7.4 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs lan disable
     7.5 -wscript C:\cygwin\home\swk\bin\toggle_if.vbs wireless enable
     7.6 -netsh interface ip set address "ワイヤレス ネットワーク接続" static 10.240.10.207 255.255.255.0 10.240.10.1 1
     7.7 -netsh interface ip set dns "ワイヤレス ネットワーク接続" static 130.34.54.2
     7.8 -netsh interface ip add dns "ワイヤレス ネットワーク接続" 130.34.232.25