批处理:从字符串中删除字符串
我有来自维基百科的以下批处理脚本:
@echo off
for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do (
echo %%f
)
pause
我这里了解到 %%~nf
仅返回不带扩展名的文件名。 现在我只想从文件名中删除 (Video)
(%%~nf
)。 我怎么能这么做呢?
I have the following batch script from Wikipedia:
@echo off
for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do (
echo %%f
)
pause
I learned here that %%~nf
returns just the filename without the extension.
Now I just wanted to remove (Video)
from the filenames (%%~nf
).
How could I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
查看以下链接,了解如何使用字符串替换删除子字符串:
http ://www.dostips.com/DtTipsStringManipulation.php#Snippets.Remove
Try this:
Take a look at the following link to learn about removing a substring using string substitution:
http://www.dostips.com/DtTipsStringManipulation.php#Snippets.Remove