Board logo

标题: [已结]文件夹下面所有的文件名,小写的全换为大写! [打印本页]

作者: dj0733     时间: 2008-11-18 15:12    标题: [已结]文件夹下面所有的文件名,小写的全换为大写!

打比方。一个文件夹里的文件名太多了。
我整理了一下,但是发现大小写差次不齐,
所以。我想要一个BAT 批处理。谢谢

[ Last edited by HAT on 2008-11-19 at 12:33 ]
作者: tireless     时间: 2008-11-18 16:45
http://upload.cn-dos.net/img/1106.zip

  Quote:
chgcase.exe
Filename & directory case convertion.
http://cdebrock.free.fr/

chgcase.exe [-u -l -c -d -f] directory1 directory* file1 file*
  -u: change to uppercase
  -l: change to lowercase
  -c: capitalize (first letter only: my file.ext -> My file.ext)
  -C: capitalize (all words: my file.ext -> My File.ext)
  -d: process directories only
  -f: process files only
  -v: verbose mode
Wildcards are ok.
Filters are applied in this order: u l c C.
-d and -f are default (process files AND directories)

ex.:
chgcase -v -l -c -f *
  Lowercase then capitalize all files (not directories).
chgcase -v -u -c -d *
  Uppercase then capitalize all directories (not files).


作者: HAT     时间: 2008-11-18 17:31

@echo off
set SrcDir=C:\test\aa
for %%a in ("%SrcDir%\*.*") do (
  set "str=%%~nxa"
  setlocal enabledelayedexpansion
  for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
    set str=!str:%%a=%%a!
  )
  ren "%%a" "!str!"
)

作者: dj0733     时间: 2008-11-19 12:18
感謝版 主!