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

首頁(yè) > 編程 > VBScript > 正文

收藏的比較精典VBS代碼

2019-10-26 17:58:47
字體:
供稿:網(wǎng)友

文件操作

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

Set fso = Wscript.CreateObject("Scripting.FileSystemObject") '創(chuàng)建文件系統(tǒng)對(duì)象,用以處理驅(qū)動(dòng)器、文件夾和文件
Set WshShell = Wscript.CreateObject("Wscript.Shell") '創(chuàng)建系統(tǒng)Shell對(duì)象,用以運(yùn)行程序等等
if fso.fileexists("D:/刀劍Online/alreadyexist.txt") then '如果找到文件“D:/刀劍 Online/alreadyexist.txt”則
WshShell.Run("D:/刀劍Online/刀劍Online.exe") '運(yùn)行“D:/刀劍Online/刀劍Online.exe”
elseif fso.fileexists("http://gengxin/update/dj.exe") then '否則,如果找到“//gengxin/update/dj.exe”則
WshShell.Run("http://gengxin/update/dj.exe") '運(yùn)行“//gengxin/update/dj.exe”
else
WshShell.Run("D:/刀劍Online/刀劍Online.exe") '否則運(yùn)行“D:/刀劍Online/刀劍Online.exe”
end if '根據(jù)條件執(zhí)行語(yǔ)句結(jié)束


VBS 導(dǎo)入注冊(cè)表,然后執(zhí)行文件
復(fù)制代碼 代碼如下:

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

PING內(nèi)網(wǎng) 不通就 執(zhí)行關(guān)機(jī) 的VBS
復(fù)制代碼 代碼如下:

strIP = "192.168.0.254" '被PING的內(nèi)網(wǎng)機(jī)器
Set objShell = CreateObject("WScript.Shell")
If Not IsOnline(strIP) Then objShell.run "shutdown -s -t 30 -c "&chr(34)&"機(jī)器即將關(guān)閉"&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

開機(jī)腳本VBS用于ARP邦定
復(fù)制代碼 代碼如下:

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

運(yùn)行程序
復(fù)制代碼 代碼如下:

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

運(yùn)行 oshell.run "d:/soft/hf/hfgame3/GameClient.lnk"

斷開網(wǎng)絡(luò)連接
復(fù)制代碼 代碼如下:

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


啟動(dòng)網(wǎng)絡(luò)連接
復(fù)制代碼 代碼如下:

strNICName = " enable =net pci/*"
Set objShell = CreateObject("Wscript.Shell")
strCommand = "devcon.exe"& strNICName
objShell.Run strCommand, 0, False
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 嘉定区| 牟定县| 平果县| 祁门县| 拉萨市| 瓦房店市| 丰都县| 张北县| 英吉沙县| 榆中县| 前郭尔| 湖口县| 灵山县| 富锦市| 辽阳市| 牡丹江市| 鹰潭市| 依安县| 沈丘县| 鹤岗市| 盐津县| 九台市| 商城县| 灯塔市| 资溪县| 浙江省| 怀宁县| 松滋市| 平乐县| 车险| 厦门市| 宜章县| 桃园市| 瑞丽市| 庆云县| 寿阳县| 重庆市| 邵阳县| 旺苍县| 西宁市| 汤原县|