复制代码
- @echo off
- title By bean -2012-5-5
- ::
- ::┌─────────────────────┐
- ::│ 更新目录 │
- ::│ │
- ::└─────────────────────┘
- ::
- ::准备文件
- if not exist d:\qoo更新日志.txt copy \\n29\e\QD\File\qoo更新日志.txt d:\qoo更新日志.txt
- echo.>>d:\qoo更新日志.txt
- echo.——————————————————————————————>>d:\qoo更新日志.txt
- echo.——————————————————————————————>>d:\qoo更新日志.txt
- echo.%date%>>d:\qoo更新日志.txt
- echo.%time%>>d:\qoo更新日志.txt
- ::
- ::┌─────────────────────┐
- ::│ 定义变量 │
- ::│ │
- ::└─────────────────────┘
- ::
- ::定义要删除的文件
- set del1=old.dll
- set del2=old.exe
- set del3=old.sam
- ::定义要更新文件
- set copy1=new.dll
- set copy2=new.exe
- set copy3=new.sam
- ::更新1
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 1 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo1" (
- if exist d:\Qoo\"Qooo1"\"%copy1%" (
- echo.%time% 目录 - 1 没有更新>>d:\qoo更新日志.txt
- echo. 目录 - 1 没有更新
- ) else (
- echo.%time% 目录 - 1 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo. 目录 - 1 更新成功
- )
- del d:\Qoo\"Qooo1"\"%del1%"
- del d:\Qoo\"Qooo1"\"%del2%"
- del d:\Qoo\"Qooo1"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo1"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo1"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo1"\"%copy3%"
- copy \\n29\e\QD\lnk\1.lnk C:\Users\Administrator\Desktop\"Qooo 1.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 1.lnk" del C:\Users\Administrator\Desktop\"Qooo 1.lnk"
- echo.%time% XXXXXX 目录 - 1 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 1 更新失败,请检查是否存在该目录
- )
- ::更新2
- echo.正在更新 目录 2 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo2" (
- if exist d:\Qoo\"Qooo2"\"%copy1%" (
- echo.%time% 目录 - 2 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 2 没有更新
- ) else (
- echo.%time% 目录 - 2 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 2 更新成功
- )
- del d:\Qoo\"Qooo2"\"%del1%"
- del d:\Qoo\"Qooo2"\"%del2%"
- del d:\Qoo\"Qooo2"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo2"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo2"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo2"\"%copy3%"
- copy \\n29\e\QD\lnk\2.lnk C:\Users\Administrator\Desktop\"Qooo 2.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 2.lnk" del C:\Users\Administrator\Desktop\"Qooo 2.lnk"
- echo.%time% XXXXXX 目录 - 2 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 2 更新失败,请检查是否存在该目录
- )
- ::更新3
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 3 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo3" (
- if exist d:\Qoo\"Qooo3"\"%copy1%" (
- echo.%time% 目录 - 3 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 3 没有更新
- ) else (
- echo.%time% 目录 - 3 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 3 更新成功
- )
- del d:\Qoo\"Qooo3"\"%del1%"
- del d:\Qoo\"Qooo3"\"%del2%"
- del d:\Qoo\"Qooo3"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo3"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo3"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo3"\"%copy3%"
- copy \\n29\e\QD\lnk\3.lnk C:\Users\Administrator\Desktop\"Qooo 3.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 3.lnk" del C:\Users\Administrator\Desktop\"Qooo 3.lnk"
- echo.%time% XXXXXX 目录 - 3 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 3 更新失败,请检查是否存在该目录
- )
- ::更新4
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 4 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo4" (
- if exist d:\Qoo\"Qooo4"\"%copy1%" (
- echo.%time% 目录 - 4 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 4 没有更新
- ) else (
- echo.%time% 目录 - 4 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 4 更新成功
- )
- del d:\Qoo\"Qooo4"\"%del1%"
- del d:\Qoo\"Qooo4"\"%del2%"
- del d:\Qoo\"Qooo4"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo4"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo4"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo4"\"%copy3%"
- copy \\n29\e\QD\lnk\4.lnk C:\Users\Administrator\Desktop\"Qooo 4.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 4.lnk" del C:\Users\Administrator\Desktop\"Qooo 4.lnk"
- echo.%time% XXXXXX 目录 - 4 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 4 更新失败,请检查是否存在该目录
- )
- ::更新5
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 5 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo5" (
- if exist d:\Qoo\"Qooo5"\"%copy1%" (
- echo.%time% 目录 - 5 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 5 没有更新
- ) else (
- echo.%time% 目录 - 5 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 5 更新成功
- )
- del d:\Qoo\"Qooo5"\"%del1%"
- del d:\Qoo\"Qooo5"\"%del2%"
- del d:\Qoo\"Qooo5"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo5"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo5"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo5"\"%copy3%"
- copy \\n29\e\QD\lnk\5.lnk C:\Users\Administrator\Desktop\"Qooo 5.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 5.lnk" del C:\Users\Administrator\Desktop\"Qooo 5.lnk"
- echo.%time% XXXXXX 目录 - 5 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 5 更新失败,请检查是否存在该目录
- )
- ::更新6
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 6 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo6" (
- if exist d:\Qoo\"Qooo6"\"%copy1%" (
- echo.%time% 目录 - 6 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 6 没有更新
- ) else (
- echo.%time% 目录 - 6 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 6 更新成功
- )
- del d:\Qoo\"Qooo6"\"%del1%"
- del d:\Qoo\"Qooo6"\"%del2%"
- del d:\Qoo\"Qooo6"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo6"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo6"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo6"\"%copy3%"
- copy \\n29\e\QD\lnk\6.lnk C:\Users\Administrator\Desktop\"Qooo 6.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 6.lnk" del C:\Users\Administrator\Desktop\"Qooo 6.lnk"
- echo.%time% XXXXXX 目录 - 6 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 6 更新失败,请检查是否存在该目录
- )
- ::更新7
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 7 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo7" (
- if exist d:\Qoo\"Qooo7"\"%copy1%" (
- echo.%time% 目录 - 7 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 7 没有更新
- ) else (
- echo.%time% 目录 - 7 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 7 更新成功
- )
- del d:\Qoo\"Qooo7"\"%del1%"
- del d:\Qoo\"Qooo7"\"%del2%"
- del d:\Qoo\"Qooo7"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo7"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo7"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo7"\"%copy3%"
- copy \\n29\e\QD\lnk\7.lnk C:\Users\Administrator\Desktop\"Qooo 7.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 7.lnk" del C:\Users\Administrator\Desktop\"Qooo 7.lnk"
- echo.%time% XXXXXX 目录 - 7 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 7 更新失败,请检查是否存在该目录
- )
- ::更新8
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 8 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo8" (
- if exist d:\Qoo\"Qooo8"\"%copy1%" (
- echo.%time% 目录 - 8 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 8 没有更新
- ) else (
- echo.%time% 目录 - 8 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 8 更新成功
- )
- del d:\Qoo\"Qooo8"\"%del1%"
- del d:\Qoo\"Qooo8"\"%del2%"
- del d:\Qoo\"Qooo8"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo8"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo8"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo8"\"%copy3%"
- copy \\n29\e\QD\lnk\8.lnk C:\Users\Administrator\Desktop\"Qooo 8.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 8.lnk" del C:\Users\Administrator\Desktop\"Qooo 8.lnk"
- echo.%time% XXXXXX 目录 - 8 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 8 更新失败,请检查是否存在该目录
- )
- ::更新9
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 9 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo9" (
- if exist d:\Qoo\"Qooo9"\"%copy1%" (
- echo.%time% 目录 - 9 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 9 没有更新
- ) else (
- echo.%time% 目录 - 9 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 9 更新成功
- )
- del d:\Qoo\"Qooo9"\"%del1%"
- del d:\Qoo\"Qooo9"\"%del2%"
- del d:\Qoo\"Qooo9"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo9"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo9"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo9"\"%copy3%"
- copy \\n29\e\QD\lnk\9.lnk C:\Users\Administrator\Desktop\"Qooo 9.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 9.lnk" del C:\Users\Administrator\Desktop\"Qooo 9.lnk"
- echo.%time% XXXXXX 目录 - 9 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 9 更新失败,请检查是否存在该目录
- )
- ::更新10
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 10 >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo10" (
- if exist d:\Qoo\"Qooo10"\"%copy1%" (
- echo.%time% 目录 - 10 没有更新>>d:\qoo更新日志.txt
- echo.目录 - 10 没有更新
- ) else (
- echo.%time% 目录 - 10 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo.目录 - 10 更新成功
- )
- del d:\Qoo\"Qooo10"\"%del1%"
- del d:\Qoo\"Qooo10"\"%del2%"
- del d:\Qoo\"Qooo10"\"%del3%"
- copy \\n29\e\QD\Qoo\"%copy1%" d:\Qoo\"Qooo10"\"%copy1%"
- copy \\n29\e\QD\Qoo\"%copy2%" d:\Qoo\"Qooo10"\"%copy2%"
- copy \\n29\e\QD\Qoo\"%copy3%" d:\Qoo\"Qooo10"\"%copy3%"
- copy \\n29\e\QD\lnk\10.lnk C:\Users\Administrator\Desktop\"Qooo 10.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist C:\Users\Administrator\Desktop\"Qooo 10.lnk" del C:\Users\Administrator\Desktop\"Qooo 10.lnk"
- echo.%time% XXXXXX 目录 - 10 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - 10 更新失败,请检查是否存在该目录
- )
- echo 运行成功共10项
- pause
复制代码
- @echo off
- title By bean -2012-5-5
- ::
- ::┌─────────────────────┐
- ::│ 更新目录 │
- ::│ │
- ::└─────────────────────┘
- ::
- ::准备文件
- if not exist d:\qoo更新日志.txt copy \\n29\e\QD\File\qoo更新日志.txt d:\qoo更新日志.txt
- echo.>>d:\qoo更新日志.txt
- echo.——————————————————————————————>>d:\qoo更新日志.txt
- echo.——————————————————————————————>>d:\qoo更新日志.txt
- echo.%date%>>d:\qoo更新日志.txt
- echo.%time%>>d:\qoo更新日志.txt
- ::
- ::┌─────────────────────┐
- ::│ 定义变量 │
- ::│ │
- ::└─────────────────────┘
- ::
- ::定义要删除的文件
- set del1=old.dll
- set del2=old.exe
- set del3=old.sam
- ::定义要更新文件
- set copy1=new.dll
- set copy2=new.exe
- set copy3=new.sam
- setlocal enabledelayedexpansion
- for /l %%i in (1 1 10) do (
- echo.>>d:\qoo更新日志.txt
- echo.正在更新 目录 %%i >>d:\qoo更新日志.txt
- if exist d:\Qoo\"Qooo%%i" (
- if exist d:\Qoo\"Qooo%%i"\"!copy1!" (
- echo.%time% 目录 - 1 没有更新>>d:\qoo更新日志.txt
- echo. 目录 - 1 没有更新
- ) else (
- echo.%time% 目录 - 1 更新成功,你是个人才啊!!!>>d:\qoo更新日志.txt
- echo. 目录 - 1 更新成功
- )
- for /l %%j in (1 1 3) do (
- del "d:\Qoo\Qooo%%i\!del%%j!"
- copy "\\n29\e\QD\Qoo\!copy%%j!" "d:\Qoo\Qooo%%i\!copy%%j!"
- )
- copy "\\n29\e\QD\lnk\%%i.lnk" "C:\Users\Administrator\Desktop\Qooo %%i.lnk"
- echo.>>d:\qoo更新日志.txt
- ) Else (
- if exist "C:\Users\Administrator\Desktop\Qooo %%i.lnk" del "C:\Users\Administrator\Desktop\Qooo %%i.lnk"
- echo.%time% XXXXXX 目录 - %%i 更新失败,请检查是否存在该目录>>d:\qoo更新日志.txt
- echo.目录 - %%i 更新失败,请检查是否存在该目录
- )
- )
- pause
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |