nice batch

来源:互联网 发布:微盘程序源码 编辑:程序博客网 时间:2024/05/18 21:50




1.变量延迟和变量替换
rem this batch is used to eliminate those unnecessary language tag
@echo
 off
setlocal enabledelayedexpansion
for /r %%i in (*.xml) do (
    
set ke=%%i
rem replace the  by /
    set file=!ke:=/!
rem agurments are bracked by "" in case of the backspace in the path
    Xml2Xls.exe "!file!" "!file!"
)
pause
 2.使用命令结果
rem Create directory and copy files
@echo off
for /"tokens=*" %%i in ('dir /ad /b') do (
    
md "%%iAssetsXMLText"
    
copy "%%i*.xml" "%%iAssetsXMLText"
    del 
"%%i*.xml"
)
pause