重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

vbs如何实现管理网卡脚本-创新互联

这篇文章将为大家详细讲解有关vbs如何实现管理网卡脚本,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

成都创新互联公司主要从事成都网站制作、做网站、网页设计、企业做网站、公司建网站等业务。立足成都服务于洪,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18982081108
'dislan.vbs    
  'usage:   cscript   /nologo   dislan.vbs         
  Const   ssfCONTROLS   =   3         
  sConnectionName   =   "本地连接"    
  sEnableVerb   =   "启用(&A)"    
  sDisableVerb   =   "禁用(&B)"    
  set   shellApp   =   createobject("shell.application")    
  set   oControlPanel   =   shellApp.Namespace(ssfCONTROLS)    
  set   oNetConnections   =   nothing    
  for   each   folderitem   in   oControlPanel.items    
 if   folderitem.name     =   "网络和拨号连接"   then    
  set   oNetConnections   =   folderitem.getfolder:   exit   for    
  end   if    
  next    
  if   oNetConnections   is   nothing   then    
  wscript.quit    
  end   if    
  set   oLanConnection   =   nothing    
  for   each   folderitem   in   oNetConnections.items    
  if   lcase(folderitem.name)     =   lcase(sConnectionName)   then    
  set   oLanConnection   =   folderitem:   exit   for    
  end   if    
  next    
  if   oLanConnection   is   nothing   then    
  wscript.quit    
  end   if    
  bEnabled   =   true    
  set   oEnableVerb   =   nothing    
  set   oDisableVerb   =   nothing    
  s   =   "Verbs:   "   &   vbcrlf    
  for   each   verb   in   oLanConnection.verbs    
  s   =   s   &   vbcrlf   &   verb.name    
  if   verb.name   =   sEnableVerb   then      
  set   oEnableVerb   =   verb        
  bEnabled   =   false    
  end   if    
  if   verb.name   =   sDisableVerb   then      
  set   oDisableVerb   =   verb        
  end   if    
  next    
     
  if   bEnabled   then    
  oDisableVerb.DoIt    
  else    
  oEnableVerb.DoIt    
  end   if    
  wscript.sleep   1000

关于“vbs如何实现管理网卡脚本”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。


网页名称:vbs如何实现管理网卡脚本-创新互联
文章起源:http://cqcxhl.com/article/pdesj.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP