|
6#
楼主 |
发表于 2020-3-10 21:33:21
|
只看该作者
没有办法,网上找了个批处理来清空回收站
/*&cls
@echo off
set "netpath=%systemroot%\Microsoft.NET\Framework"
for /f "delims=" %%a in ('dir /ad /b "%netpath%\v?.*"') do (
if exist "%netpath%\%%a\csc.exe" (
set "cscpath=%netpath%\%%a\csc.exe"
goto :0
)
)
echo;未安装.Net Framework 2.0及其上版本组件或相关程序丢失&pause&exit
:0
"%cscpath%" /nologo /out:"%tmp%\$EmptyRecycle.exe" "%~f0"
"%tmp%\$EmptyRecycle.exe"
rem pause&exit
*/
using System;
using System.Runtime.InteropServices;
class EmptyRecycle
{
const int SHERB_NOCONFIRMATION = 0x000001; //不显示确认删除的对话框
const int SHERB_NOPROGRESSUI = 0x000002; //不显示删除过程的进度条
//const int SHERB_NOSOUND = 0x000004; //当删除完成时,不播放声音
[DllImportAttribute("shell32.dll")]
private static extern int SHEmptyRecycleBin(IntPtr handle, string root, int falgs);
static void Main(string[] args)
{
SHEmptyRecycleBin(IntPtr.Zero, "", SHERB_NOCONFIRMATION|SHERB_NOPROGRESSUI);
}
} |
|