答案1
我也认为你的方法不可行。以下批处理/vbscript 只给了我一小部分有用的重命名(@Vinayak 我会将 -Whatif 附加到副本无法评论)批处理输出重命名命令,你可以将其重定向到类似“DoRenames.cmd”的文件并在修订后执行。
::ListLnkProps.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off&setlocal enabledelayedexpansion
:: create .\ListLnkProps.vbs
for /f "tokens=1 delims=:" %%A in (
'findstr /I /N "##ListLnkProps" ^<"%~f0"') do set /A ln#=%%A - 1
more +%ln#% "%~f0" >"%~dpn0.vbs"
:: List.lnk file properties in curent folder and subfolders
for /f "delims=" %%A in (
'dir /A-D /b /s *.lnk'
) do cscript //nologo "%~dpn0.vbs" "%%A"
goto :eof
' ##ListLnkProps.vbs
set WshShell = WScript.CreateObject("WScript.Shell")
File = WScript.Arguments.Unnamed(0)
set Lnk = WshShell.CreateShortcut(File)
NewName = Lnk.Description & ".lnk"
If Len(Lnk.Description) > 8 Then
wscript.Echo "Ren " & chr(34) & File & chr(34) & " " & _
chr(34) & NewName & chr(34)
End If
set Lnk = Nothing
编辑附加的示例输出
> q:\test\2016-11\05\ListLnkProps.cmd
Ren "C:\Users\UserName\Desktop\Google Chrome.lnk" "Internetzugriff.lnk"
Ren "C:\Users\UserName\Desktop\On-Screen Keyboard.lnk" "Zeigt eine Tastatur an, die von einer Maus oder einem Umschalteingabegerät gesteuert wird..lnk"
Ren "C:\Users\UserName\Desktop\Programm_Links\Alarm.lnk" "Digital Alarm Clock.lnk"
Ren "C:\Users\UserName\Desktop\Programm_Links\Avira.lnk" "Avira starten.lnk"
Ren "C:\Users\UserName\Desktop\Programm_Links\Bitvise SSH Client.lnk" "Bitvise SSH Client L7.15 - a general-purpose SSH client: supports tunneling (manual and via integrated proxy), SFTP file transfer, bridging of FTP clients to SFTP, remote console access and remote administration of Bitvise SSH Server (WinSSHD)..lnk"
Ren "C:\Users\UserName\Desktop\Programm_Links\calibre - E-book management.lnk" "Manage your e-book collection and download news.lnk"
Ren "C:\Users\UserName\Desktop\Programm_Links\calibre 64bit - E-book management.lnk" "Manage your e-book collection and download news.lnk"
Ren "C:\Users\UserName\Desktop\Programm_Links\CDBurnerXP.lnk" "CDBunerXP.lnk"
高血压
答案2
谢谢JasonMArcher 的回答,你可以使用 Powershell 对文件夹中的每个快捷方式执行类似这样的操作:
$lnk = "path\to\shortcut.lnk"
$dest = $Env:Userprofile + "\Desktop\"
$shell = New-Object -COM WScript.Shell
Copy-Item $lnk $($dest +
(Get-Item $shell.CreateShortcut($lnk).TargetPath).VersionInfo.FileDescription + ".lnk") -WhatIf
使用脚本时删除-WhatIf
末尾的。
PS 如果您了解 Powershell,请随意改进我的答案。