bat命令(.bat文件) 删除文件
背景:有个logs文件夹,每天会自动生成日志info.日期.log怎么写bat命令删除一周之前的日志。我会做计划任务(Windows机器)主要就是问下bat怎么写,因为涉...
背景:有个logs文件夹,每天会自动生成日志 info.日期.log
怎么写bat命令删除一周之前的日志。我会做计划任务(Windows机器)
主要就是问下bat怎么写,因为涉及到一个文件名通配符的问题。
比如,1月7号,我要删除1月1号的日志。
1月8号,我就要删除1月2号的日志。
坐等高手解决啊。 展开
怎么写bat命令删除一周之前的日志。我会做计划任务(Windows机器)
主要就是问下bat怎么写,因为涉及到一个文件名通配符的问题。
比如,1月7号,我要删除1月1号的日志。
1月8号,我就要删除1月2号的日志。
坐等高手解决啊。 展开
7个回答
推荐于2017-09-29 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517169
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
方法如下:
1、点击开始,点击所有程序,点击附件,点击记事本;
2、记事本中按格式输入以下内容:del 路径\文件名 /q,例如删除c盘windows文件夹下temp文件夹的所有文件,输入:del c:\windows\temp\*.* /q;
3、点击文件菜单另存为命令,选择保存位置为桌面,文件名1.bat,保存类型所有文件,点击保存即可。
1、点击开始,点击所有程序,点击附件,点击记事本;
2、记事本中按格式输入以下内容:del 路径\文件名 /q,例如删除c盘windows文件夹下temp文件夹的所有文件,输入:del c:\windows\temp\*.* /q;
3、点击文件菜单另存为命令,选择保存位置为桌面,文件名1.bat,保存类型所有文件,点击保存即可。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
@echo off
echo 正在清除文件,请稍等......
del 文件目录\*.log
echo 清除结束
echo. & pause
新建TXT 复制以上代码,修改文件目录
把后缀名txt改成bat然后按回车
至于删除一周前的,可以建立计划任务。
echo 正在清除文件,请稍等......
del 文件目录\*.log
echo 清除结束
echo. & pause
新建TXT 复制以上代码,修改文件目录
把后缀名txt改成bat然后按回车
至于删除一周前的,可以建立计划任务。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不好用,你在硬盘里非系统分区安装雨木林风4.0OS(linux),进入linux删除!注意它默认删除后在你删除的东西隐藏在她的分区,是trash文件夹好想记不清了,再显示隐藏的文件夹,再删除就够了。这个系统可以进入以前的系统方便的卸载,雨木林风官网有教程很简单。我自己尝试了才敢说!很简单的哦
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Windows 7服务优化bat(复制进txt,修改扩展名为bat,右键“以管理员身份运行”即可)
@echo Restore The Service Start State Saved At 19:17:02.10 2011/01/23 周日
@pause
sc config AeLookupSvc start= DEMAND
sc config ALG start= DEMAND
sc config AppIDSvc start= DEMAND
sc config Appinfo start= DEMAND
sc config AppMgmt start= DEMAND
sc config AudioEndpointBuilder start= AUTO
sc config Audiosrv start= AUTO
sc config AxInstSV start= DEMAND
sc config BDESVC start= DEMAND
sc config BFE start= DISABLED
sc config BITS start= DISABLED
sc config Browser start= DISABLED
sc config bthserv start= DEMAND
sc config CertPropSvc start= DEMAND
sc config clr_optimization_v2.0.50727_32 start= AUTO
sc config COMSysApp start= DEMAND
sc config CryptSvc start= AUTO
sc config CscService start= DEMAND
sc config DcomLaunch start= AUTO
sc config defragsvc start= DEMAND
sc config Dhcp start= AUTO
sc config Dnscache start= AUTO
sc config dot3svc start= DEMAND
sc config DPS start= DISABLED
sc config EapHost start= DEMAND
sc config EFS start= DEMAND
sc config ehRecvr start= DEMAND
sc config ehSched start= DEMAND
sc config eventlog start= AUTO
sc config EventSystem start= DISABLED
sc config Fax start= DEMAND
sc config fdPHost start= DEMAND
sc config FDResPub start= DEMAND
sc config FontCache start= DEMAND
sc config FontCache3.0.0.0 start= DEMAND
sc config gpsvc start= AUTO
sc config hidserv start= DEMAND
sc config hkmsvc start= DEMAND
sc config HomeGroupListener start= DEMAND
sc config HomeGroupProvider start= DEMAND
sc config idsvc start= DEMAND
sc config IKEEXT start= DISABLED
sc config IPBusEnum start= DEMAND
sc config iphlpsvc start= DISABLED
sc config KeyIso start= DEMAND
sc config KtmRm start= DEMAND
sc config LanmanServer start= DISABLED
sc config LanmanWorkstation start= AUTO
sc config lltdsvc start= DEMAND
sc config lmhosts start= DISABLED
sc config Mcx2Svc start= DISABLED
sc config MMCSS start= AUTO
sc config MpsSvc start= DISABLED
sc config MSDTC start= DEMAND
sc config MSiSCSI start= DISABLED
sc config msiserver start= DEMAND
sc config napagent start= DISABLED
sc config Netlogon start= DEMAND
sc config Netman start= DEMAND
sc config netprofm start= DEMAND
sc config NetTcpPortSharing start= DISABLED
sc config NlaSvc start= AUTO
sc config nsi start= AUTO
sc config p2pimsvc start= DEMAND
sc config p2psvc start= DEMAND
sc config PcaSvc start= DEMAND
sc config PeerDistSvc start= DEMAND
sc config pla start= DEMAND
sc config PlugPlay start= AUTO
sc config PNRPAutoReg start= DEMAND
sc config PNRPsvc start= DEMAND
sc config PolicyAgent start= AUTO
sc config Power start= AUTO
sc config ProfSvc start= AUTO
sc config ProtectedStorage start= DEMAND
sc config QWAVE start= DEMAND
sc config RasAuto start= DEMAND
sc config RasMan start= DEMAND
sc config RemoteAccess start= DISABLED
sc config RemoteRegistry start= DISABLED
sc config RpcEptMapper start= AUTO
sc config RpcLocator start= DEMAND
sc config RpcSs start= AUTO
sc config SamSs start= AUTO
sc config SCardSvr start= DEMAND
sc config Schedule start= AUTO
sc config SCPolicySvc start= DEMAND
sc config SDRSVC start= DEMAND
sc config seclogon start= DEMAND
sc config SENS start= AUTO
sc config SensrSvc start= DEMAND
sc config SessionEnv start= DEMAND
sc config SharedAccess start= DISABLED
sc config ShellHWDetection start= DISABLED
sc config SNMPTRAP start= DEMAND
sc config Spooler start= DISABLED
sc config sppsvc start= AUTO
sc config sppuinotify start= DEMAND
sc config SSDPSRV start= DISABLED
sc config SstpSvc start= DEMAND
sc config StiSvc start= DEMAND
sc config StorSvc start= DEMAND
sc config swprv start= DEMAND
sc config SysMain start= DISABLED
sc config TabletInputService start= DISABLED
sc config TapiSrv start= DEMAND
sc config TBS start= DEMAND
sc config TermService start= DEMAND
sc config Themes start= AUTO
sc config THREADORDER start= DEMAND
sc config TrkWks start= AUTO
sc config TrustedInstaller start= DEMAND
sc config UI0Detect start= DEMAND
sc config UmRdpService start= DEMAND
sc config upnphost start= DEMAND
sc config UxSms start= AUTO
sc config VaultSvc start= DEMAND
sc config vds start= DEMAND
sc config VSS start= DEMAND
sc config W32Time start= DEMAND
sc config wbengine start= DEMAND
sc config WbioSrvc start= DEMAND
sc config wcncsvc start= DEMAND
sc config WcsPlugInService start= DEMAND
sc config WdiServiceHost start= DEMAND
sc config WdiSystemHost start= DEMAND
sc config WebClient start= DISABLED
sc config Wecsvc start= DEMAND
sc config wercplsupport start= DEMAND
sc config WerSvc start= DEMAND
sc config WinDefend start= DISABLED
sc config WinHttpAutoProxySvc start= DEMAND
sc config Winmgmt start= AUTO
sc config WinRM start= DEMAND
sc config Wlansvc start= DEMAND
sc config wmiApSrv start= DEMAND
sc config WMPNetworkSvc start= DEMAND
sc config WPCSvc start= DEMAND
sc config WPDBusEnum start= DEMAND
sc config wscsvc start= DISABLED
sc config WSearch start= AUTO
sc config wuauserv start= DISABLED
sc config wudfsvc start= DEMAND
sc config WwanSvc start= DEMAND
@pause
@echo Restore The Service Start State Saved At 19:17:02.10 2011/01/23 周日
@pause
sc config AeLookupSvc start= DEMAND
sc config ALG start= DEMAND
sc config AppIDSvc start= DEMAND
sc config Appinfo start= DEMAND
sc config AppMgmt start= DEMAND
sc config AudioEndpointBuilder start= AUTO
sc config Audiosrv start= AUTO
sc config AxInstSV start= DEMAND
sc config BDESVC start= DEMAND
sc config BFE start= DISABLED
sc config BITS start= DISABLED
sc config Browser start= DISABLED
sc config bthserv start= DEMAND
sc config CertPropSvc start= DEMAND
sc config clr_optimization_v2.0.50727_32 start= AUTO
sc config COMSysApp start= DEMAND
sc config CryptSvc start= AUTO
sc config CscService start= DEMAND
sc config DcomLaunch start= AUTO
sc config defragsvc start= DEMAND
sc config Dhcp start= AUTO
sc config Dnscache start= AUTO
sc config dot3svc start= DEMAND
sc config DPS start= DISABLED
sc config EapHost start= DEMAND
sc config EFS start= DEMAND
sc config ehRecvr start= DEMAND
sc config ehSched start= DEMAND
sc config eventlog start= AUTO
sc config EventSystem start= DISABLED
sc config Fax start= DEMAND
sc config fdPHost start= DEMAND
sc config FDResPub start= DEMAND
sc config FontCache start= DEMAND
sc config FontCache3.0.0.0 start= DEMAND
sc config gpsvc start= AUTO
sc config hidserv start= DEMAND
sc config hkmsvc start= DEMAND
sc config HomeGroupListener start= DEMAND
sc config HomeGroupProvider start= DEMAND
sc config idsvc start= DEMAND
sc config IKEEXT start= DISABLED
sc config IPBusEnum start= DEMAND
sc config iphlpsvc start= DISABLED
sc config KeyIso start= DEMAND
sc config KtmRm start= DEMAND
sc config LanmanServer start= DISABLED
sc config LanmanWorkstation start= AUTO
sc config lltdsvc start= DEMAND
sc config lmhosts start= DISABLED
sc config Mcx2Svc start= DISABLED
sc config MMCSS start= AUTO
sc config MpsSvc start= DISABLED
sc config MSDTC start= DEMAND
sc config MSiSCSI start= DISABLED
sc config msiserver start= DEMAND
sc config napagent start= DISABLED
sc config Netlogon start= DEMAND
sc config Netman start= DEMAND
sc config netprofm start= DEMAND
sc config NetTcpPortSharing start= DISABLED
sc config NlaSvc start= AUTO
sc config nsi start= AUTO
sc config p2pimsvc start= DEMAND
sc config p2psvc start= DEMAND
sc config PcaSvc start= DEMAND
sc config PeerDistSvc start= DEMAND
sc config pla start= DEMAND
sc config PlugPlay start= AUTO
sc config PNRPAutoReg start= DEMAND
sc config PNRPsvc start= DEMAND
sc config PolicyAgent start= AUTO
sc config Power start= AUTO
sc config ProfSvc start= AUTO
sc config ProtectedStorage start= DEMAND
sc config QWAVE start= DEMAND
sc config RasAuto start= DEMAND
sc config RasMan start= DEMAND
sc config RemoteAccess start= DISABLED
sc config RemoteRegistry start= DISABLED
sc config RpcEptMapper start= AUTO
sc config RpcLocator start= DEMAND
sc config RpcSs start= AUTO
sc config SamSs start= AUTO
sc config SCardSvr start= DEMAND
sc config Schedule start= AUTO
sc config SCPolicySvc start= DEMAND
sc config SDRSVC start= DEMAND
sc config seclogon start= DEMAND
sc config SENS start= AUTO
sc config SensrSvc start= DEMAND
sc config SessionEnv start= DEMAND
sc config SharedAccess start= DISABLED
sc config ShellHWDetection start= DISABLED
sc config SNMPTRAP start= DEMAND
sc config Spooler start= DISABLED
sc config sppsvc start= AUTO
sc config sppuinotify start= DEMAND
sc config SSDPSRV start= DISABLED
sc config SstpSvc start= DEMAND
sc config StiSvc start= DEMAND
sc config StorSvc start= DEMAND
sc config swprv start= DEMAND
sc config SysMain start= DISABLED
sc config TabletInputService start= DISABLED
sc config TapiSrv start= DEMAND
sc config TBS start= DEMAND
sc config TermService start= DEMAND
sc config Themes start= AUTO
sc config THREADORDER start= DEMAND
sc config TrkWks start= AUTO
sc config TrustedInstaller start= DEMAND
sc config UI0Detect start= DEMAND
sc config UmRdpService start= DEMAND
sc config upnphost start= DEMAND
sc config UxSms start= AUTO
sc config VaultSvc start= DEMAND
sc config vds start= DEMAND
sc config VSS start= DEMAND
sc config W32Time start= DEMAND
sc config wbengine start= DEMAND
sc config WbioSrvc start= DEMAND
sc config wcncsvc start= DEMAND
sc config WcsPlugInService start= DEMAND
sc config WdiServiceHost start= DEMAND
sc config WdiSystemHost start= DEMAND
sc config WebClient start= DISABLED
sc config Wecsvc start= DEMAND
sc config wercplsupport start= DEMAND
sc config WerSvc start= DEMAND
sc config WinDefend start= DISABLED
sc config WinHttpAutoProxySvc start= DEMAND
sc config Winmgmt start= AUTO
sc config WinRM start= DEMAND
sc config Wlansvc start= DEMAND
sc config wmiApSrv start= DEMAND
sc config WMPNetworkSvc start= DEMAND
sc config WPCSvc start= DEMAND
sc config WPDBusEnum start= DEMAND
sc config wscsvc start= DISABLED
sc config WSearch start= AUTO
sc config wuauserv start= DISABLED
sc config wudfsvc start= DEMAND
sc config WwanSvc start= DEMAND
@pause
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询