婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > 用vbs實(shí)現(xiàn)本地連接禁用/啟用腳本代碼

用vbs實(shí)現(xiàn)本地連接禁用/啟用腳本代碼

熱門標(biāo)簽:外呼線路中繼線是什么 深圳外呼系統(tǒng)收費(fèi) 合肥高德地圖標(biāo)注 怎么看地圖標(biāo)注 廣州ai電銷機(jī)器人一般多少錢 百度地圖標(biāo)注是什么意思 外呼系統(tǒng)telrobot 外呼系統(tǒng)免費(fèi)招代理 拉薩外呼系統(tǒng)業(yè)務(wù)
轉(zhuǎn)載至 http://community.csdn.net/Expert/topic/4881/4881882.xml

復(fù)制代碼 代碼如下:

Const ssfCONTROLS = 3 

sConnectionName = "本地連接"  '可改成需要控制的連接名稱,如"無(wú)線網(wǎng)絡(luò)連接"等 

sEnableVerb = "啟用(A)" 
sDisableVerb = "禁用(B)"   'XP系統(tǒng)中應(yīng)為 "停用(B)" 

set shellApp = createobject("shell.application") 
set oControlPanel = shellApp.Namespace(ssfCONTROLS) 

set oNetConnections = nothing 
for each folderitem in oControlPanel.items 
 if folderitem.name  = "網(wǎng)絡(luò)連接" then 
   set oNetConnections = folderitem.getfolder: exit for 
 end if 
next 

if oNetConnections is nothing then 
 msgbox "未找到網(wǎng)絡(luò)連接文件夾" 
 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 
 msgbox "未找到 '"  sConnectionName  "' item" 
 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 

'debugging displays left just in case... 

'msgbox s ': wscript.quit 
'msgbox "Enabled: "  bEnabled ': wscript.quit 

'not sure why, but invokeverb always seemed to work  
'for enable but not disable.   

'saving a reference to the appropriate verb object  
'and calling the DoIt method always seems to work. 

if bEnabled then 
'  oLanConnection.invokeverb sDisableVerb 
 oDisableVerb.DoIt 
else 
'  oLanConnection.invokeverb sEnableVerb 
 oEnableVerb.DoIt 
end if 

'adjust the sleep duration below as needed... 

'if you let the oLanConnection go out of scope 
'and be destroyed too soon, the action of the verb 
'may not take... 

wscript.sleep 400 
您可能感興趣的文章:
  • 用vbs實(shí)現(xiàn)禁用服務(wù)
  • vbscript禁用 啟用fso的方法
  • 使用 iisext.vbs 禁用 Web 服務(wù)擴(kuò)展的方法
  • bat生成vbs通過(guò)注冊(cè)表禁用或啟用USB端口的代碼
  • 使用VBS禁用、啟動(dòng)USB存儲(chǔ)設(shè)備
  • VB實(shí)現(xiàn)禁用任務(wù)管理器的方法

標(biāo)簽:周口 廣安 玉林 嘉興 漳州 延安 六安 臺(tái)灣

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《用vbs實(shí)現(xiàn)本地連接禁用/啟用腳本代碼》,本文關(guān)鍵詞  用,vbs,實(shí)現(xiàn),本地,連接,禁用,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《用vbs實(shí)現(xiàn)本地連接禁用/啟用腳本代碼》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于用vbs實(shí)現(xiàn)本地連接禁用/啟用腳本代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 洪湖市| 习水县| 闸北区| 邵武市| 城口县| 通道| 绿春县| 教育| 滨州市| 烟台市| 阿合奇县| 华池县| 兖州市| 资溪县| 忻州市| 仲巴县| 丰原市| 三穗县| 泽州县| 亳州市| 孟州市| 溆浦县| 铜梁县| 马尔康县| 佛冈县| 庐江县| 历史| 元谋县| 綦江县| 广宁县| 新安县| 那坡县| 盐城市| 洛宁县| 石家庄市| 于都县| 渭源县| 深州市| 故城县| 无极县| 大石桥市|