批处理文件 - 删除第二个文件扩展名 [英] Batch File - Remove Second File Extension

查看:159
本文介绍了批处理文件 - 删除第二个文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用批处理文件有没有办法,我可以脱掉所有文件的扩展名指向.deploy目录中。

例如

  1.txt.deploy => 1.TXT
2.txt.deploy => 2.txt


解决方案

 重命名* .txt.deploy *。

一个更加花哨的解决方案:

  @ECHO OFF
FOR %%在f IN(* .txt.deploy)DO重命名%% F%%〜NF

Using a batch file is there a way that I can strip off the .deploy extension from all files in a directory.

For example

1.txt.deploy => 1.txt
2.txt.deploy => 2.txt 

etc

解决方案

RENAME *.txt.deploy *.

A more 'fancy' solution:

@ECHO OFF
FOR %%f IN (*.txt.deploy) DO RENAME "%%f" "%%~nf"

这篇关于批处理文件 - 删除第二个文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆