|
|
发表于 2009-3-11 13:56:22
|
显示全部楼层
用vbs可以,但要注册dynwrap.dll,比着葫芦画瓢,来个vbs版的:- Dim hWndOwner, Drive, Flags, iResult
- Dim Sherb_noSound, Sherb_noProgressUi, Sherb_noConfirmation, error_success
- Sherb_noSound = 4 ' 无删除声音
- Sherb_noProgressUi = 2 ' 无删除界面
- Sherb_noConfirmation = 1 ' 无确认
- error_success = 0
- ' API 参数
- hWndOwner = 0 ' 对话框父窗口句柄
- Drive = NUL ' 盘符,NUL 为所有盘符,or "c:\", "d:\program files\"
- Flags = Sherb_noSound Or Sherb_noProgressUi Or Sherb_noConfirmation ' 标志
- Set Wrap = CreateObject("DynamicWrapper")
- Wrap.Register "Shell32.dll", "SHEmptyRecycleBin", "i=hsu", "R=l"
- iResult = Wrap.SHEmptyRecycleBin(hWndOwner, Drive, Flags)
- ' msgbox(iResult)
复制代码 dynwrap.dll 下载地址 http://bbs.bathome.net/thread-2882-1-1.html
返回值为error_success则调用成功。
[ 本帖最后由 pusofalse 于 2009-3-11 14:19 编辑 ] |
|