本帖最后由 pcl_test 于 2017-6-6 18:45 编辑
回复 5# dnvplj - /*&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"
- 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);
- }
- }
复制代码
|