|
VBS脚本应用-其它示列(7) AutoRunProgram.Write RegPath&Key_Name,Key_Data,Type_Name '在启动组中添加自启动程序autorun.exe
实现整理磁盘碎片功能
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim fso, d, dc Set fso = CreateObject("Scripting.FileSystemObject") Set dc = fso.Drives For Each d in dc If d.DriveType = 2 Then Return = WshShell.Run("defrag " & d & " -f", 1, TRUE) End If Next
Set WshShell = Nothing
计划任务定时调用VBS脚本(未知功能)
Option Explicit On Error Resume Next
'生成列表的文件类型 Const sListFileType = "wmv,rm,wma"
'文件所在的相对路径 Const sShowPath="."
'排序类型的常量定义 Const iOrderFieldFileName = 0 Const iOrderFieldFileExt = 1 Const iOrderFieldFileSize = 2 Const iOrderFieldFileType = 3 Const iOrderFieldFileDate = 4
'排序顺逆的常量定义 const iOrderAsc = 0 const iOrderDesc = 1
'生成列表的文件数量 const iShowCount = 20
'显示的日期格式函数 Function Cndate2(date1,intDateStyle) dim strdate,dDate1 strdate=CStr(date1)
|