Shingo@1: if WScript.Arguments.Count <> 2 then Shingo@1: wscript.quit Shingo@1: end if Shingo@1: Shingo@1: Dim sConnectionName Shingo@1: if WScript.Arguments.Item(0) = "lan" then Shingo@1: sConnectionName = "ローカル エリア接続" Shingo@1: else Shingo@1: sConnectionName = "ワイヤレス ネットワーク接続" Shingo@1: end if Shingo@1: Shingo@1: Dim sVerb Shingo@1: if WScript.Arguments.Item(1) = "enable" then Shingo@1: sVerb = "有効にする(&A)" Shingo@1: else Shingo@1: sVerb = "無効にする(&B)" Shingo@1: end if Shingo@1: Shingo@1: Shingo@1: Const ssfCONTROLS = 3 Shingo@1: Const sConPaneName = "ネットワーク接続" Shingo@1: Shingo@1: set shellApp = createobject("shell.application") Shingo@1: set oControlPanel = shellApp.Namespace(ssfCONTROLS) Shingo@1: set oNetConnections = nothing Shingo@1: Shingo@1: for each folderitem in oControlPanel.items Shingo@1: if folderitem.name = sConPaneName then Shingo@1: set oNetConnections = folderitem.getfolder: exit for Shingo@1: end if Shingo@1: next Shingo@1: Shingo@1: if oNetConnections is nothing then Shingo@1: wscript.quit Shingo@1: end if Shingo@1: Shingo@1: set oLanConnection = nothing Shingo@1: for each folderitem in oNetConnections.items Shingo@1: if lcase(folderitem.name) = lcase(sConnectionName) then Shingo@1: set oLanConnection = folderitem: exit for Shingo@1: end if Shingo@1: next Shingo@1: Shingo@1: if oLanConnection is nothing then Shingo@1: wscript.quit Shingo@1: end if Shingo@1: Shingo@1: for each verb in oLanConnection.verbs Shingo@1: if verb.name = sVerb then Shingo@1: verb.Doit Shingo@1: WScript.Sleep 2000 Shingo@1: end if Shingo@1: next