当前位置: 移动技术网 > IT编程>脚本编程>VBScript > 管理网卡vbs脚本

管理网卡vbs脚本

2017年12月12日  | 移动技术网IT编程  | 我要评论

品德与社会六年级下册教案,jsp教程下载,选项卡

'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   

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网