帮我看看这个批处理文件是什么意思咯?

来源:百度知道 编辑:UC知道 时间:2024/05/14 03:57:59
@echo off
rem MYCOPY.BAT copies any number files
rem to a directory
rem The command uses the following syntax:
rem mycopy dir file1 file2...
set todir=%1
:getfile
shift
if "%1:"==""goto end
copy %1 %todir%
goto getfile
:end
set todir=
echo All done

C:\>mycopy.bat doc a.doc b.doc c.doc

表示把C:\下面的a.doc b.doc c.doc三个文件拷贝到C:\doc目录中。
后面的参数个数可以是任意多个。

上面代码中好像有错误:

应该把
if "%1:"==""goto end
改为
if %1=="" goto end