当前位置:编程学习 > JAVA >>

cp

::portalone 应用地址
set portalone=E:\svn\code1126\tomcat
::比对文件结果列表
set lst=tomcat.txt

set /a count1=0
set /a count2=0
set /a count3=0
echo off
color f9
set curPath=%cd%
for %%p in ("%cd%") do (set curDriver=%%~dp)
:input
if not exist "%portalone%" ( echo portalone应用地址 ) &&(set /p portalone="")
if not exist "%portalone%" (echo "输入地址无效") &&goto input
:inputLst
if not exist "%lst%" ( echo 比对文件结果列表 ) &&(set /p lst="")
if not exist "%lst%" (echo "文件列表无效") &&goto inputLst

for %%p in (%portalone%) do set nextDriver=%%~dp
%nextDriver%
echo #%date% %time%>"%curPath%\~info"
echo #portalone应用地址  %portalone% >>"%curPath%\~info"
echo ##路径 >"%curPath%\~tmpPath"
set errorFlag=false
cd "%portalone%"
for %%p in ("%portalone%") do (set curContextPath=%%~pp)
set driver=""
echo y|copy "%curPath%\%lst%" .\ 
for /f "eol=# tokens=1,2 delims= " %%f in (%lst%) do if exist %%f ((set driver=%%~df) &&echo %%~pf  %%~nf%%~xf>>"%curPath%\~tmpPath") else ((set errorFlag=true)&&set /a count3=count3+1 &&echo !%blank% 文件 %portalone%\%%f 不存在 >>"%curPath%\~info")
echo y|copy "%curPath%\~tmpPath" .\ 
del /s /q %lst%
set blank = "  "
for /f "eol=# tokens=1,2 delims= " %%f in (~tmpPath) do ( (if not exist "%curPath%\src\%%f" ( (md "%curPath%\src\%%f") &&set /a count1=count1+1 &&echo #创建文件夹 "%curPath%\src\%%f">>"%curPath%\~info")) &&if exist "%%f%%g" ((attrib -S -H "%%f%%g") &&set /a count2=count2+1 &&(echo y|copy "%%f%%g" "%curPath%\src%%f") &&echo #%blank%复制文件 "%driver%%%f%%g" 到  "%curPath%\src%%f" >>"%curPath%\~info" ) else ((set errorFlag=true)&&set /a count3=count3+1  &&echo !%blank% 文件 "%%f%%g" 不存在 >>"%curPath%\~info"))
del /s /q ~tmpPath
%curDriver%
cd %curPath%
::del /s /q ~tmpPath
cd "%ContextPath%"
echo y|xcopy /e /c /h /r "src%curContextPath%*" .\
rmdir /s /q src
echo #创建文件夹 %count1% 个>>"%curPath%\~info"
echo #复制文件 %count2% 个>>"%curPath%\~info"
echo #复制错误 %count3% 个>>"%curPath%\~info"
cls
if %errorFlag% neq true (goto correct) else (goto errors)
goto end
:correct
if exist "%curPath%\~tmpPath" del /s /q "%curPath%\~tmpPath"
::if exist "%curPath%\~info" del /s /q "%curPath%\~info"
if exist "%curPath%\~error" del /s /q "%curPath%\~error"
::cd "src%curContextPath%"
goto end
:errors
echo #%date% %time%>.\~error
for /f "eol=# tokens=1 delims=" %%h in (~info) do echo %%h>>~error
notepad ~error
goto end
:end
cls
echo on
--------------------编程问答-------------------- what? --------------------编程问答-------------------- 啊 波 么 佛 , 的 特 呢 了 。。。
补充:Java ,  非技术区
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,