国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

收藏的比較精典VBS代碼

2020-03-24 19:01:53
字體:
來源:轉載
供稿:網友
Set fso = Wscript.CreateObject("Scripting.FileSystemObject") '創建文件系統對象,用以處理驅

動器、文件夾和文件 Set WshShell = Wscript.CreateObject("Wscript.Shell") '創建系統Shell對象,用以運行程序等等 if fso.fileexists("D:/刀劍Online/alreadyexist.txt") then '如果找到文件“D:/刀劍

Online/alreadyexist.txt”則 WshShell.Run("D:/刀劍Online/刀劍Online.exe") '運行“D:/刀劍Online/刀劍Online.exe” elseif fso.fileexists("http://gengxin/update/dj.exe") then '否則,如果找到

“//gengxin/update/dj.exe”則 WshShell.Run("http://gengxin/update/dj.exe") '運行“//gengxin/update/dj.exe” else WshShell.Run("D:/刀劍Online/刀劍Online.exe") '否則運行“D:/刀劍Online/刀劍Online.exe” end if '根據條件執行語句結束

VBS 導入注冊表,然后執行文件

dim Wsh Set Wsh = WScript.CreateObject("WScript.Shell") Wsh.RegWrite "HKCU/SOFTWARE/AUDITION/AUTOSTART",0,"REG_DWORD" Wsh.RegWrite "HKCU/SOFTWARE/AUDITION/PATH","G:/網絡游戲/勁舞團1.5","REG_SZ" Wsh.RegWrite "HKCU/SOFTWARE/AUDITION/VERSION",1010,"REG_DWORD" Wsh.run "patcher.exe"

PING內網 不通就 執行關機 的VBS

strIP = "192.168.0.254" '被PING的內網機器 Set objShell = CreateObject("WScript.Shell")

If Not IsOnline(strIP) Then objShell.run "shutdown -s -t 30 -c "&chr(34)&"機器即將關閉"&chr(34) End If

Function IsOnline(strComputer) IsOnline = false strCommand = "%comspec% /c ping -n 2 -w 500 " & strComputer & "" Set objExecObject = objShell.Exec(strCommand) Do While Not objExecObject.StdOut.AtEndOfStream strText = objExecObject.StdOut.ReadAll() If Instr(strText, "Reply") 0 Then IsOnline = true End If Loop End Function

開機腳本VBS用于ARP邦定 Set WshShell = Wscript.CreateObject("Wscript.Shell") WshShell.run "arp -s 192.168.0.1 30-18-e5-33-01",0 WshShell.run "arp -s 192.168.0.5 30-18-e5-33-07",0

運行程序

Dim a

Set Wsh = WScript.CreateObject("WScript.Shell") a.Run "d:/網絡游戲/大話西游II/xy-2.exe"

運行 oshell.run "d:/soft/hf/hfgame3/GameClient.lnk"

斷開網絡連接

strNICName = " disable =net pci/*" Set objShell = CreateObject("Wscript.Shell") strCommand = "devcon.exe"& strNICName objShell.Run strCommand, 0, False

啟動網絡連接

strNICName = " enable =net pci/*" Set objShell = CreateObject("Wscript.Shell") strCommand = "devcon.exe"& strNICName objShell.Run strCommand, 0, False

刪除文件的VBS腳本

dim fso Set fso = CreateObject("Scripting.FileSystemObject")

fso.CopyFile "http://server/共享/XXX.lnk","c:/目標位置1/",true '添加 fso.CopyFile "http://server/共享/XXX.lnk","c:/目標位置2/",true '添加

fso.DeleteFile "c:/目標位置1/XXX.lnk" ,true '刪除 fso.DeleteFile "c:/目標位置2/XXX.lnk" ,true '刪除

Set FSO=NoThing WScript.quit
html教程

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 永川市| 久治县| 曲靖市| 武宣县| 翁源县| 积石山| 长兴县| 磐安县| 新竹县| 泉州市| 五华县| 泸水县| 苏尼特左旗| 永胜县| 盱眙县| 紫金县| 博白县| 天长市| 探索| 六盘水市| 靖远县| 郧西县| 兴国县| 锡林郭勒盟| 蓬安县| 阿坝| 德化县| 南平市| 安义县| 来安县| 安图县| 白沙| 板桥市| 宜阳县| 常州市| 巩义市| 瑞昌市| 瑞昌市| 桦甸市| 瑞昌市| 辽宁省|