Dim objCP, objEnable, objDisable, colNetwork Dim clsConn, clsLANConn, clsVerb, Ag Dim strNetConn, strConn, strEnable, strDisable, strStatus Dim bEnabled, bDisabled, CmdLine Set objShell = CreateObject("Shell.Application") strNetConn = "Сетевые подключения" strConn = "Подключение по локальной сети" strEnable = "&Включить" strDisable = "&Отключить" Set WshShell = WScript.CreateObject ("WScript.Shell") Set Ag = Wscript.Arguments CmdLine = Ag.Item(0) If CmdLine = 0 Or 1 Then Call GetFolder() Sub GetFolder() Set objCP = objShell.Namespace(3) Set colNetwork = Nothing For Each clsConn in objCP.Items If clsConn.Name = strNetConn Then Set colNetwork = clsConn.getfolder Call LANConn() Exit For End If Next If colNetwork Is Nothing Then Exit Sub End Sub Sub LANConn() Set clsLANConn = Nothing For Each clsConn in colNetwork.Items If InStr(LCase(clsConn.name),LCase(strConn)) Then Set clsLANConn = clsConn Call Connection() Exit For End If Next If clsLANConn Is Nothing Then Exit Sub End Sub Sub Connection() bEnabled = True Set objEnable = Nothing Set objDisable = Nothing For Each clsVerb in clsLANConn.verbs If clsVerb.name = strEnable Then Set objEnable = clsVerb bEnabled = False End If If clsVerb.name = strDisable Then Set objDisable = clsVerb End If Next If bEnabled = True And CmdLine = 0 Then objDisable.DoIt End If If bEnabled = False And CmdLine = 1 Then objEnable.DoIt End If WScript.Sleep 1000 End Sub