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

首頁 > 編程 > VBScript > 正文

用VBS來代替BAT或CMD文件進行命令第1/2頁

2019-10-26 18:00:55
字體:
來源:轉載
供稿:網友
自動導入注冊表的,帶檢測:
On Error Resume Next
dim msg,fso,shell
Set fso = Wscript.createobject("scripting.filesystemobject")
set wshshell = wscript.CreateObject("wscript.shell")
set shell = wscript.createobject("wscript.shell")
IF (fso.FileExists("e:/勁樂團/reg.reg")) Then 
shell.run "c:/windows/Regedit.exe /s e:/勁樂團/reg.reg "
shell.run "e:/勁樂團/O2Jam.exe" 
Else

msg=msgbox("注冊表未導入,游戲可能無法啟動,如無法進游戲請叫網管~",1,"出問題啦!!")
shell.run "e:/勁樂團/O2Jam.exe"
end if



不帶檢測的:

On Error Resume Next
Dim oShell,fso
Set oShell = WScript.CreateObject("WScript.Shell")
set fso = CreateObject("Scripting.filesystemobject")
oShell.Run "regedit /s 9you.reg" 
oShell.Run "d:/網絡游戲/勁樂團/O2Jam.exe"

自動加載虛擬光驅的:

Dim oShell
Set oshell= WScript.CreateObject("WScript.Shell")
oShell.Run "c:/progra~1/daemon~1/daemon.exe -mount 0,D:/lan/戰地2/BF2CD1mini.mds"
wscript.sleep 5000
oShell.Run "D:/lan/戰地2/BF2.exe"

另一例子:

Dim Wsh,DMpath,ISOpath
DMpath = "X:/Y/daemon.exe" '設置DM路徑
ISOpath = "Z:/大富翁七/RICH7B.mds" '設置鏡像文件路徑
Set Wsh = WScript.CreateObject("WScript.Shell")
Wsh.run chr(34) & DMpath & chr(34) &" -mount 0,"&ISOpath,0,true

Wscript.Sleep 3000 '最好延時幾秒等待鏡像加載完畢 1000 = 1 秒

Wsh.run "Z:/大富翁七/rich7.exe" 
Set WSH = Nothing
WScript.quit

//每次開機的時候自動導入注冊表和程序
Option Explicit
Dim Folder


Folder = "d:/aaa" '設置你要執行的文件夾


Dim Wsh,fso
Set Wsh = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim f,fc,f1,ext
Set f = fso.GetFolder(Folder)
Set fc = f.Files
For Each f1 in fc
ext = LCase(fso.GetExtensionName(f1))
Select Case ext
Case "exe"
wsh.run f1,,true
Case "reg"
wsh.run "Regedit /s "& f1,,true
end Select
Next


Set fso=NoThing
Set Wsh = Nothing
WScript.quit

//排除指定文件或文件夾刪除多余的文件或文件夾,黑火原創
Option Explicit

''''''''''''''說明''''''''''''
'網盟-黑火制作,送給需要的朋友。
'配置文件“Listfile.ini”的格式如下:
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 鹿泉市| 金乡县| 古浪县| 武宁县| 黔南| 驻马店市| 都江堰市| 凉城县| 汝城县| 上饶市| 壤塘县| 平邑县| 姜堰市| 新化县| 瓮安县| 九龙县| 张家川| 峨边| 宜兰市| 布拖县| 哈尔滨市| 台山市| 车险| 东丰县| 靖州| 定兴县| 乌拉特前旗| 沈丘县| 陆良县| 安宁市| 韩城市| 施甸县| 象山县| 太原市| 怀化市| 青海省| 阳曲县| 广宗县| 淮安市| 临澧县| 武定县|