DDK Source Files Allot
2008-09-17 16:03
239 查看
:: DDK Source Files Allot :: 从DDK的cab中解压出来的文件没有目录层级,但每个文件的文件名中包含了该文件所应 :: 处于的位置。本批处理将处理单个目录中的所有文件,解析每个文件名,将之改为正确 :: 名称并放入正确位置。 经测试适用于98DDK :: Author: ZeroFire(炽火) :: ver beat0.1[20080910] @echo off setlocal enabledelayedexpansion rem mode con lines=26 color 1f cls title 批量处理DDK中解压的文件名 set fullpath=%~dp0 set selfname=%~nx0 :start set oldname= :: 遍历当前目录下的所有文件 for /f "usebackq delims=" %%f in (`dir /b/a-d .`) do ( set "var=%%~nf" for /f "tokens=1,2,3,4,5,6,7,8,9* delims=_" %%i in ("!var!") do ( call :mkdir %%f %%i %%j %%k %%l %%m %%n %%o %%p %%q ) ) goto ok :: 函数mkdir按照给定参数顺序检查是否存在匹配的目录树,如果不存在则创建该目录 :: 然后将文件改为正确名称后移动到正确位置 :: %1是目标文件名 %2~9之后是目录树 :mkdir if "%3"=="" ( goto :EOF ) set shortname=%1 :loop if "%3"=="" ( move "%fullpath%%1" "!shortname!" set shortpath=%CD% set "shortpath=!shortpath:%fullpath%=!" echo !shortpath!\!shortname! ) else ( if not exist "%2" ( md "%2" ) cd "%2" set "shortname=!shortname:%2_=!" shift /2 goto loop ) cd %fullpath% goto :EOF :: 显示成功信息并退出 :ok echo done ^^_^^ pause >nul goto :EOF
相关文章推荐
- DDK Source Files Allot
- Key Character Map Files - http://source.android.com
- ddk开发基础 makefile和source文件
- “! LaTeX source files more than 5 years old!.”解决方案(转)
- 手记04之例程安排组织文件Sourcefiles
- A duplicate insert block exists for class "XXX" in the source files (X:\XXX.h, X:\XXX.cpp).
- 重新想象 Windows 8 Store Apps (53) - 绑定: 与 ObservableCollection CollectionViewSource VirtualizedFilesVector VirtualizedItemsVector 绑定
- [Webpack 2] Ensure all source files are included in test coverage reports with Webpack
- VScode-Go can't load package: package .: no buildable Go source files in
- Android Studio中CMake编译NDK时,切换编译编译platform API--Cannot find source file:CMakeFiles/CMakeTmp/testCComp
- Class Wizard Error: A duplicate insert block exists for class (CMyclass) in the source files
- A duplicate insert block exists for class "COneValuDlg" in the source files
- Qt+VS "Error C1083 Cannot open source file: 'GeneratedFiles\Debug\moc_xxx"
- ICE Manual(Documentation for Ice 3.5)---Slice Source Files
- The source files "*\A.cpp " and "*\A.cpp " are both configured to produce the output file "*\A.obj "
- android C/C++ source files 全局宏定义 .
- Namespaces, Source Files, and Distribution(Chapter 16 of Programming Ruby)
- The source files...are both configured to produce the output file,The project cannot be built.
- VC编译错误:The source files "*\A.cpp " and "*\A.cpp " are both configured to produce the output file "*\