本人用proe搞3D设计,proe每保存一次会生成一个新版本文件,如:旧版为aa.prt.1,新版为:aa.prt.2,依次向上,虽然软件中提供pruge.bat,在工作目录删除旧版文件,但日久的很多文件夹都会存在旧版文件,盼提供一快捷方法,一次清理掉某个盘中的旧版文件。
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off
cd.>tmp1.txt
for /f "delims=" %%i in ('dir /a-d /b /s d:\aa.prt.*') do echo %%~xi "%%i">>tmp1.txt
sort /r<tmp1.txt>tmp2.txt
echo 要删除的旧文件有:
for /f "skip=1 tokens=1*" %%i in (tmp2.txt) do echo %%j
del /q tmp1.txt tmp2.txt
pause
@echo off
cd.>tmp1.txt
cd.>tmp2.txt
for /f "delims=" %%i in ('dir /a-d /b /s d:\*.prt.*^|findstr /i "\.prt\.*$"') do echo %%~xi "%%i">>tmp1.txt
sort /r<tmp1.txt>tmp2.txt
echo 要删除的旧文件有:
for /f "skip=1 tokens=1*" %%i in (tmp2.txt) do echo %%j
del /q tmp1.txt tmp2.txt
pause
@echo off
cls
title Purge Subs
if !%1==! goto nopath
if not exist %1*.* goto badpath
:start
title Purge Subs from %1
call :subpurge %1
FOR /D /R %%a IN (*.*) do call :subpurge "%%a"
goto complete
:subpurge
echo Purging, %1
cd "%1"
call purge.bat
goto :EOF
:nopath
echo.
echo ERROR - No path provided....
echo.
echo You must provide a path when calling %0
goto complete
:badpath
echo.
echo ERROR - "%1" is not a valid path....
echo.
echo You must provide a valid path when calling %0
goto complete
:complete
echo.
pause
exit;
; Purge Pro/E Subs from Explorer
;
signature="$CHICAGO$"
CopyFiles = PurgeProSubs.Files.Inf
AddReg = PurgeProSubs.Reg
CopyFiles = PurgeProSubs.Files.Inf
AddReg = PurgeProSubs.Reg
CopyFiles = PurgeProSubs.Files.Inf
AddReg = PurgeProSubs.Reg.NT
DelFiles = PurgeProSubs.Files.Inf
DelReg = PurgeProSubs.Reg
DelFiles = PurgeProSubs.Files.Inf
DelReg = PurgeProSubs.Reg.NT
55="Purge Pro/E Files","",1
PurgeProSubs.INF=55
PurgeProSubs.Files.Inf = 17
PurgeProSubs.INF
; This section is for Win95 (untested on Win95)
HKLM,%UDHERE%
HKLM,%UDHERE%,DisplayName,,"%PurgeProSubsName%"
HKLM,%UDHERE%,UninstallString,,"%10%\rundll.exe setupx.dll,InstallHinfSection DefaultUninstall 132 %17%\PurgeProSubs.inf"
HKCR,Directory\Shell\PurgeProSubs,,,"%PurgeProSubsAccel%"
;-----------------This is the line that calls the purge.bat file-----\
HKCR,Directory\Shell\PurgeProSubs\command,,,"%10%\command.exe /c purgesubs.bat ""%1""
; This section is for WinNT 4.0
HKLM,%UDHERE%
HKLM,%UDHERE%,DisplayName,,"%PurgeProSubsName%"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 132 %17%\PurgeProSubs.inf"
HKCR,Directory\Shell\PurgeProSubs,,,"%PurgeProSubsAccel%"
;-----------------This is the line that calls the purge.bat file-----\
HKCR,Directory\Shell\PurgeProSubs\command,,,"%11%\cmd.exe /c purgesubs.bat ""%1""
; This is the name which shows up in the "Add/Remove Programs" list
PurgeProSubsName="Pro/E Purge Subs command (Remove Only)"
; This is the menu entry that shows up when you right click on a folder in explorer
; The "&" caues the next character to be (underlined) hot key
PurgeProSubsAccel="Pro/E Purge &Subs"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\PurgeProSubs"