You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows命令行获取文件名首字母及移除首下划线失败的问题求助

Windows命令行获取文件名首字母及移除首下划线失败的问题求助

我最近碰到个棘手的小问题,想批量去掉一批DLL文件名开头的下划线,比如把_Telerik.Windows.*.dll这类文件名改成不带首下划线的版本,试了命令但一直报错,实在没辙了来求大家帮忙!

我用的命令是这样的:

for %f in (_Telerik.Windows.*.dll) do set "filename=%f" && ren "%f" "%filename:~1%"

结果每次执行都会弹出类似下面的错误提示:

C:\Directory\set "filename=_Telerik.Windows.Themes.Windows8Touch.dll" && ren "_Telerik.Windows.Themes.Windows8Touch.dll" "Telerik.Windows.Zip.dll"
A duplicate file name exists, or the file cannot be found.

C:\Directory\set "filename=_Telerik.Windows.Zip.dll" && ren "_Telerik.Windows.Zip.dll" "Telerik.Windows.Zip.dll"
A duplicate file name exists, or the file cannot be found.

对了,我已经提前开启了setlocal enabledelayedexpansion,但还是解决不了这个问题。有没有大佬能教教我怎么正确移除这些文件名开头的下划线呀?

备注:内容来源于stack exchange,提问作者Dominique

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 11:33:10