- 帖子
- 5
- 积分
- 17
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2020-11-14
|
感谢ivor大神提供的代码,问题已解决。
谢谢各位关注及参与。分享代码:
#&cls&@powershell "Invoke-Expression ([Io.File]::ReadAllText('%~0'))" &pause&exit
dir -Recurse -Filter *.html | %{
$title = [Regex]::Match((gc $_.FullName),"(?<=<title>).*(?=</title>)")
$img = [Regex]::Match((gc $_.FullName),"(?<=src="").*(?=\"")")
$title = $title.Value
$img = $img.Value.Substring(1)
$ext = "."+$img.Split(".")[2]
Rename-Item -Path $img -NewName $title$ext -Verbose
} |
|