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