查询具有特定名称的文件 [英] Query files with specific name

查看:69
本文介绍了查询具有特定名称的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在寻找脚本(powershell或vbs),它将查询名称中包含符号"〜"的文件。并显示我最后的修改日期(输出到文件)。

我还需要额外的脚本,这将删除查询的文件,但我想有一个选项来选择应删除的文件修改时间(如超过XX天)。



提前致谢!

解决方案


看看Get-ChildItem:


http://technet.microsoft.com/ en-us / library / ee176841.aspx


您可以使用它来获取文件列表,然后检查每个文件的LastWriteTime属性。


对于删除,您可以使用Remove-Item:


http://technet.microsoft.com/en-us/library/ee176938.aspx


Hi guys, I`m looking for script (powershell or vbs) which will query files which name contains symbol "~" and which show me last date of modification (output to file).
I need also additional script  which will delete the queried files, but I want to have a option to chose files should be deleted based on modification time (like older than XX days).

Thanks in advance!

解决方案

Hi,

Look at Get-ChildItem:

http://technet.microsoft.com/en-us/library/ee176841.aspx

You can use that to get your list of files and then check the LastWriteTime property of each file.

As for deleting, you can use Remove-Item:

http://technet.microsoft.com/en-us/library/ee176938.aspx


这篇关于查询具有特定名称的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆