快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

Powershell批量重命名

先创建几个用于测试的文件
$Directory = "C:\Test"
For($i=0;$i -le 10; ++$i) {
Set-Content -Path $("$Directory\Test($i).txt") -value $i 
}

创建结果如下图:
Powershell 批量重命名

创新互联是一家专注于成都网站制作、网站建设与策划设计,卢龙网站建设哪家好?创新互联做网站,专注于网站建设十载,网设计领域的专业建站公司;建站业务涵盖:卢龙等地区。卢龙做网站价格咨询:18980820575

使用下面的命令把Test换成Mail

PS D:\> $Directory = "C:\Test"
PS D:\> Get-ChildItem $Directory | Rename-Item -NewName { $_.name -Replace "Test","Mail" }

结果如下图:
Powershell 批量重命名

学习链接:

http://www.computerperformance.co.uk/powershell/powershell_replace.htm
http://www.pstips.net/bulk-renaming-files.html


本文题目:Powershell批量重命名
文章出自:http://6mz.cn/article/jgjgos.html

其他资讯