一键清除Delphi中无用的文件

本文介绍了一个用于清理Delphi项目中无用文件的自动化小工具,通过命令行界面帮助开发者高效地管理项目文件,节省空间并提高开发效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

delphi确实好用,但它生成的各种文件,有时对我们来说基本没用,随着我们做的项目越来越多,其中无用的文件有时能占到三分之一。今晚写了个小工具,可以递归清理 delphi文件夹下无用的文件。

代码如下:

@echo "清除Delphi中的无用文件 1.0"
@echo "作者:DC"
@echo off 
if   "%1"=="" (goto currentPath)
 else goto pointPath
:currentPath
set work_path=.  
:pointPath
set work_path=%1 
@echo 确定要清理%work_path%吗?
choice /c ny /m "确定按Y,取消按N"
rem errorlevel1对应n,2对应y
if errorlevel 2 goto continue
if errorlevel 1 goto complate
:continue
cd %work_path% 
for /R %%s in (.) do ( 
 rem echo %%s 
rem 删除delphi无用文件
rem del ~*.* /s
 del *.~* /s
 del *.obj /s
 del *.dcp /s
 del *.dcu /s
 rem del *.dpl /s

:complate
echo "运行完毕"
pause 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值