用户登录
用户注册

分享至

管理网卡vbs脚本

  • 作者: 嗫?暁雲?
  • 来源: 51数据库
  • 2021-08-01
'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   
软件
前端设计
程序设计
Java相关