'生成调用文件的过程
Sub ShowFileListContent()
Dim tUpdatetime,sUpdateContent
Dim fso,f,f_js,f_js_write
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(sShowPath)
Set f_js = fso.GetFile("list.js")
'比较调用文件与文件夹的最后修改时间
If f.DateLastModified<>f_js.DateLastModified then
sUpdateContent = ListFile(sListFileType,iOrderFieldFileDate,iOrderDesc,iShowCount)
Set f_js_write = fso.CreateTextFile("list.js", True)
'JS调用就加上下面这对document.write
' f_js_write.Write ("document.write('")
f_js_write.Write (sUpdateContent)
' f_js_write.Write ("')")
f_js_write.Close
End If
End Sub
Call ShowFileListContent()
可以代替网通宽带登陆器的一段vbs脚本
Dim WshShell, iexplorePath, iexploreselect
iexplorePath="c:Progra~1Intern~1iexplore.exe"
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run iexplorePath
WScript.Sleep 2000
WshShell.AppActivate "用户上网登陆"
WshShell.SendKeys "自己的账号{TAB}"
WshShell.SendKeys "自己的密码"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
利用VBS脚本创建快捷方式
我们以"QQ Aqing增强包参数配置器"为例子,讲述如何利用VBS脚本创建快捷方式.
代码:
set WshShell = Wscript.CreateObject("Wscript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "QQ Aqing增强包参数配置器.lnk")
'创建一个快捷方式对象,其在桌面上显示的名字为"QQ Aqing增强包参数配置器"
oShellLink.TargetPath = "C:Program FilesTencentQQAqing.exe"
'设置快捷方式的执行路径
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "Ctrl+Alt+e" '设置快捷方式的快捷键
oShellLink.IconLocation = "E:PictureAqing.ico" '设置快捷方式的图标路径
oShellLink.Description = "QQ Aqing增强包参数配置器" '设置快捷方式的描述
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
将上述代码保存为"CreateShortcut.vbs"(不含引号).双击CreateShortcut.vbs,就会将QQ Aqing增强包参数配置器的快捷方式建立到桌面上.
用这种方法建立的快捷方式的最大优点是:快捷方式的图标可以根据自己的喜好进行更改
用VBS脚本发送email!
[code]
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "null_vbt@163.com"
objEmail.To = "null_vbt@163.com"
objEmail.Subject = "这封邮件是由VBS脚本发送"
objEmail.Textbody = "如果你收到这封邮件,就表示测试成功!"
objEmail.Send
利用vbs脚本编写Windows XP/2003序列号更改器







