注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 CCIE-Lab考试将新增10分钟..
 帮助

其实你也行.....


2007-10-09 18:12:06
 标签:windows scripting   [推送到技术圈]

版权声明:原创作品,谢绝转载!否则将追究法律责任。
清除Windows临时目录
Option Explicit
 
Dim WshShell, WshSysEnv, Directories, Item
 
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("Process")
 
Directories = Array ( _
    WshShell.ExpandEnvironmentStrings(WshSysEnv("TEMP")), _
    WshShell.ExpandEnvironmentStrings(WshSysEnv("TMP")), _
    "C:\my application", _
    "C:\Recycled", _
    "D:\Recycled" _
)
On Error Resume Next
 
For Each Item In Directories
    If MsgBox("删除" & Item & "中所有文件和目录吗?", vbYesNo) = vbYes Then
        WshShell.Exec "cmd /k rd /q/s """ & Item & """"
        WshShell.Exec "cmd /k md """ & Item & """"
    End If
Next
 
保存为.vbs文件...运行及可~~

本文出自 “世界因你而不同” 博客,谢绝转载!





    文章评论
 
2007-10-09 21:14:38
哈哈,已经留下来

2007-10-15 07:39:47
VB高手~

2008-01-01 11:23:03
...拿了下来了...老师

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: