国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表

圖片精選

主站蜘蛛池模板: 罗平县| 冷水江市| 安岳县| 丹寨县| 太白县| 思南县| 呼图壁县| 吉林市| 寻乌县| 苍梧县| 美姑县| 中山市| 罗平县| 璧山县| 塘沽区| 葫芦岛市| 张家川| 三原县| 镇赉县| 图木舒克市| 疏勒县| 甘德县| 农安县| 新泰市| 秀山| 新民市| 威信县| 西昌市| 惠来县| 鄱阳县| 济南市| 顺平县| 平阴县| 泾源县| 弋阳县| 毕节市| 平武县| 普宁市| 南充市| 威海市| 盐城市|