梦想吧技术论坛's Archiver

似水年华 发表于 2007-4-22 06:19 PM

VBS-开机导入注册表

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

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.