首页脚本管理网卡vbs脚本

管理网卡vbs脚本

时间2024-02-11 08:34:03发布访客分类脚本浏览624
导读:收集整理的这篇文章主要介绍了管理网卡vbs脚本,觉得挺不错的,现在分享给大家,也给大家做个参考。 'dislan.vbs 'usage: cscript /noLOGo...
收集整理的这篇文章主要介绍了管理网卡vbs脚本,觉得挺不错的,现在分享给大家,也给大家做个参考。 '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   

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: 管理网卡vbs脚本
本文地址: https://pptw.com/jishu/609565.html
把任意文件转成vbs文件的file2vbs的vbs代码 用vbs实现获取电脑硬件信息的脚本

游客 回复需填写必要信息