|
|
楼主 |
发表于 2023-11-13 17:15:08
|
显示全部楼层
【方案2】
不使用原来的bat和vbs,直接使用新的 2.bat 脚本:- <# :
- @echo off
- powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0' |Out-String|Invoke-Expression"
- #>
- $Shell = New-Object -ComObject Shell.Application;
- Get-ChildItem *.pptx | ForEach-Object {
- $Folder = $Shell.Namespace($_.DirectoryName);
- $File = $Folder.ParseName($_.Name);
- $n=$Folder.GetDetailsOf($File, 158);
- $size=$Folder.GetDetailsOf($File, 1);
- ($_.fullname+":"+[string]$n+":"+$size)>>results.txt;
- ren $_.fullname ("{0}-{1}-{2}.pptx" -f $_.basename,$n,$size)
- }
复制代码 |
|