Copy Files Blurry 1.0

main.bat

  1 @echo off
  2 color 0a
  3 title Copy Files Blurry 1.0
  4 pushd "%~dp0"
  5
  6 SETLOCAL ENABLEEXTENSIONS
  7 SETLOCAL ENABLEDELAYEDEXPANSION
  8
  9 set CPB_T1=%TEMP%\cpb1.tmp
 10 set CPB_T2=%TEMP%\cpb2.tmp
 11 set CPB_T3=%TEMP%\cpb3.tmp
 12
 13 :PROC_MAIN
 14 cd . > "%CPB_T1%"
 15 echo. Note: Source folder can‘t include quotes, can‘t use the form ‘X:Y‘. Root directory ends with a backslash. The correct way of writing, such as: ‘X:\Packages‘.
 16 :ENTER_SOURCE
 17 set SOURCE=
 18 set /p SOURCE=Source folder:
 19 if "%SOURCE%" neq "" (
 20     >> "%CPB_T1%" echo %SOURCE%
 21 ) else (
 22     choice /c Yn /cs /m "End input"
 23     if !ERRORLEVEL! equ 1 (
 24         goto :PROC_SOURCE
 25     )
 26 )
 27 goto :ENTER_SOURCE
 28
 29 :PROC_SOURCE
 30 cd . > "%CPB_T2%"
 31 for /f "usebackq tokens=*" %%i in ("%CPB_T1%") do (
 32     pushd %%i && (
 33         >> "%CPB_T2%" echo !cd!
 34         popd
 35     )
 36 )
 37
 38 for /f %%i in ("%CPB_T2%") do (
 39     cls
 40     if %%~zi equ 0 (
 41         echo. Incorrect input, please re-enter.
 42         call :FN_BLOCKING
 43         goto :PROC_MAIN
 44     )
 45 )
 46
 47 :ENTER_DESTINATION
 48 set DESTINATION=
 49 set /p DESTINATION=Destination folder:
 50 if "%DESTINATION%" equ "" (
 51     call :FN_BLOCKING
 52     goto :ENTER_DESTINATION
 53 )
 54 pushd %DESTINATION% || (
 55     cls
 56     echo. Invalid destination folder.
 57     call :FN_BLOCKING
 58     goto :ENTER_DESTINATION
 59 )
 60 popd
 61 cls
 62
 63 :ENTER_KEYWORDS
 64 echo. Note: Keywords separated by spaces, such as: ‘cmake zlib-devel openssl-devel‘.
 65 set KEYWORDS=
 66 set /p KEYWORDS=Keywords:
 67 if "%KEYWORDS%" equ "" (
 68     call :FN_BLOCKING
 69     goto :ENTER_KEYWORDS
 70 )
 71 echo KEYWORDS[%KEYWORDS%]
 72 cd . > "%CPB_T3%"
 73 call :PROC_KEYWORDS %KEYWORDS%
 74 for /f %%i in ("%CPB_T3%") do (
 75     cls
 76     if %%~zi equ 0 (
 77         echo. Invalid keywords.
 78         call :FN_BLOCKING
 79         goto :ENTER_KEYWORDS
 80     )
 81 )
 82
 83 echo. Note: The following files will be copied to the destination.
 84 echo %DESTINATION%
 85 echo.
 86 for /f "usebackq tokens=*" %%i in ("%CPB_T2%") do (
 87     echo ^<%%i^>
 88     for /f "usebackq tokens=*" %%x in ("%CPB_T3%") do (
 89         echo ^|-- *%%x*
 90     )
 91 )
 92 echo. Note: it will overwrite the files already stored in the destination.
 93 choice /c Yn /cs /m "Are you sure?"
 94 cls
 95 if %ERRORLEVEL% equ 2 (
 96     goto :ENTER_KEYWORDS
 97 )
 98
 99 for /f "usebackq tokens=*" %%i in ("%CPB_T2%") do (
100     for /f "usebackq tokens=*" %%x in ("%CPB_T3%") do (
101         copy /y "%%i\*%%x*" "%DESTINATION%\"
102     )
103 )
104 echo.
105 echo Completed.
106 echo.
107 choice /c Yn /cs /m "Come again?"
108 if %ERRORLEVEL% equ 1 (
109     cls
110     goto :ENTER_KEYWORDS
111 )
112 del "%CPB_T1%" "%CPB_T2%" "%CPB_T3%"
113 exit
114
115
116 :PROC_KEYWORDS
117 if %1a==a goto :EOF
118 >> "%CPB_T3%" echo %1
119 shift
120 goto :PROC_KEYWORDS
121
122
123 @rem ##############################FBP Begin
124 @title Function Batch Program 1.0
125 @color 0a
126 @echo Note: I can‘t run independently.
127 @ping /n 3 127.0.0.1 > nul
128 @exit
129
130 rem eg. call :FN_BLOCKING
131 :FN_BLOCKING
132 choice /t 1 /c O /cs /d O /n
133 cls
134 goto :EOF
135 @rem ##############################FBP End

附件1

原文地址:https://www.cnblogs.com/rms365/p/11148531.html

时间: 2024-10-10 04:34:42

Copy Files Blurry 1.0的相关文章

Gradle Goodness: Copy Files with Filtering

Gradle Goodness: Copy Files with Filtering Gradle's copy task is very powerful and includes filtering capabilities. This means we can change the contents of the files that are copied before they reach their new destination. We use the filter() method

错误: 找不到或无法加载主类 Files\apache-activemq-5.10.0\bin\..\conf\login.config

在启动activemq的时候出现错误:“错误: 找不到或无法加载主类 Files\apache-activemq-5.10.0\bin\..\conf\login.config”,之前用activemq的时候没遇到这个问题,这次折腾就遇到了.每一次问题,都是一次收获和成长的机会,哪怕是一点点,没关系,不积跬步无以至千里! 查找login.config,明明路径E:\Program Files\apache-activemq-5.10.0\conf\login.config文件存在. 于是仔细阅读

启动eclipse是报 no java virtual machine was found after searching the following location E:/Program Files/jdk1.6.0/bin/javaw.exe

系统中本来有个eclipse,能正常启动,后来又拷贝了个新版本的,但启动就报错! 百度下,按照如下更改环境变量,试了N遍,花了若干小时,结果不行,无奈! http://blog.csdn.net/lqz1988/archive/2010/12/29/6105324.aspx 百无聊赖之下,打开eclipse目录,发现有个eclipse.ini文件,里面第二行是路径 E:/Program Files/jdk1.6.0/bin/javaw.exe 灵机一动,有门有门!,试着把 上面路径改为 D:/j

How to Copy files between ESXi hosts using SCP Command

How to Copy files between ESXi hosts using SCP command Enable SSH and allow SSH in ESXi firewall Only prerequisite to copy files between ESXi host using SCP command is that both source and destination ESXi host should have SSH enabled and SSH allowed

关于 unable to load shared object &#39;C:\Program Files\R\R-3.0.3\library\stats\libs\i386\stats.dll&#39;

这个问题花了我3个小时差文档解决.最终一位外国朋友解答了我的问题:http://rdotnet.codeplex.com/workitem/117 其实这个问题很简单就是,在R目录下的:C:\Program Files\R\R-3.0.3\library\stats\libs\i386这个目录下,拷贝一份:这个目录下的文件:C:\Program Files\R\R-3.0.3\bin\i386.然后就ok了. 看了这份回答,估计你都得喊哥了. 关于 unable to load shared o

[Bash] Move and Copy Files and Folders with Bash

In this lesson we’ll learn how to move and rename files (mv) and copy (cp) them. Move index.html to src folder: mv index.html src/index.html We can also rename the file: mv a.js b.js # rename a.js file to b.js mv src/ lib # rename src folder to lib m

nodejs copy files

var fs = require("fs"); var log = function(msg) { console.log(msg); } function copyFile(source, destination) { if (fs.existsSync(source)) { var rOption = { flags: 'r', encoding: null, mode: 0666 } var wOption = { flags: 'a', encoding: null, mode

Xcode6 ADD Copy Files Build Phase 是灰色的,不能点问题

There's a bug with Xcode where if the Build Phases tab loses focus all the options will be grayed out. You need to do the following: Click Target Name > Build Phases > Click on whitespace below phases > Editor > Add Build Phase –  Paul Solt ?O

shell &amp; dialog

最近使用dialog写图形自动化shell脚本,  功能很强大,功能不是非常多但是足够用.想写一篇linux下dialog的使用方法,虽然命令不多,但是写起来也需要下很大功夫,而且不一定写得更好,在网上发现一篇linux shell图形化脚本文件,于是转过来了. liunx 下的dialog 工具是一个可以和shell脚本配合使用的文本界面下的创建对话框的工具.每个对话框提供的输出有两种形式:1.  将所有输出到stderr 输出,不显示到屏幕.2.  使用退出状态码,“OK”为0,“NO”为1