国产探花免费观看_亚洲丰满少妇自慰呻吟_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”的格式如下:
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 神木县| 平原县| 永州市| 井陉县| 谢通门县| 新龙县| 华亭县| 南召县| 英超| 金平| 彰化市| 顺义区| 天祝| 凤阳县| 台前县| 海城市| 清水县| 延川县| 永善县| 图们市| 方山县| 武威市| 镇赉县| 五莲县| 会泽县| 页游| 叶城县| 新竹市| 印江| 太白县| 南雄市| 韶山市| 通许县| 晋州市| 贡嘎县| 宁国市| 孟津县| 兴化市| 岳西县| 普宁市| 甘南县|