- @echo off
- rem 将要重启删除的文件拖至本脚本上
- rem 暂时只支持单个文件的删除操作
- rem Code author: lxzzr e-mail: lxzzr@21cn.com
-
-
- if {%1} == {} mshta vbscript:msgbox("请将要重启删除的文件拖至本脚本上, 命令行: %~n0 [drive:][path][filename]",vbinformation,"文件重启删除脚本使用帮助")(window.close) & exit/b
-
- set filename=%~nx1
- set filepath=%~dp1
-
- pushd "%filepath%"
-
- echo.[Version] >>"%filepath%"INFFILE.INF
- echo.Signature="$Chicago$" >>"%filepath%"INFFILE.INF
-
- echo.[DestinationDirs] >>"%filepath%"INFFILE.INF
- echo.DefaultDestDir = 01 >>"%filepath%"INFFILE.INF
-
- echo.[DefaultInstall] >>"%filepath%"INFFILE.INF
- echo.DelFiles = DELETELIST >>"%filepath%"INFFILE.INF
-
- echo.[DELETELIST] >>"%filepath%"INFFILE.INF
- echo.%filename% ,,,1 >>"%filepath%"INFFILE.INF
- echo.INFFILE.INF >>"%filepath%"INFFILE.INF
-
- RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\INFFILE.INF
-
- if exist INFFILE.INF del INFFILE.INF
-
- popd
-
- exit
复制代码
|