批处理文件以删除文件

编程入门 行业动态 更新时间:2024-10-28 11:27:32
本文介绍了批处理文件以删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人可以帮我制作一个批处理文件,删除以库存水平开头的文件,这些文件是存储在C:\ Windows \ Temp文件夹中的.csv文件.

Can someone please help me to make a batch file to delete files beginning with the name Stock Level which are .csv files stored in C:\Windows\Temp folder.

我想先测试一下它,然后再发布它,看看它打算删除什么,以便有人可以显示出我也需要删除什么才能使其生效.

I would like to test it first to see what it proposes to delete before I make it live so if someone can show may what I need to delete to make it live as well.

非常感谢您的帮助.

罗伊

推荐答案

作为批处理文件,

@echo off setlocal for %%a in ("c:\windows\temp\stock level*.csv") do echo(del "%%a"

应该通过对设置为与提供的掩码匹配的每个文件名的%%a执行echo("%%a"来生成列表.

should generate your list by executing echo("%%a" for %%a set to each filenme matching the mask supplied.

如果结果正确,只需删除echo(部分以激活del

If the result is correct, simply remove the echo( part to activate the del

更多推荐

批处理文件以删除文件

本文发布于:2023-05-27 19:32:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/300547.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:批处理文件   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!